/*       */
package client;
/*       */

import client.anticheat.CheatTracker;
import client.anticheat.ReportType;
import client.inventory.*;
import client.skills.*;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import com.alibaba.druid.pool.DruidPooledConnection;
import configs.FishingConfig;
import configs.ServerConfig;
import constants.*;
import database.DatabaseConnection;
import handling.channel.ChannelServer;
import handling.login.JobType;
import handling.opcode.EffectOpcode;
import handling.opcode.FieldEffectOpcode;
import handling.world.*;
import handling.world.family.MapleFamily;
import handling.world.family.MapleFamilyBuff;
import handling.world.family.MapleFamilyCharacter;
import handling.world.guild.MapleGuild;
import handling.world.guild.MapleGuildCharacter;
import handling.world.messenger.MapleMessenger;
import handling.world.messenger.MapleMessengerCharacter;
import handling.world.messenger.MessengerRankingWorker;
import handling.world.party.MapleParty;
import handling.world.party.MaplePartyCharacter;
import io.netty.channel.Channel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import scripting.event.EventInstanceManager;
import scripting.map.MapScriptMethods;
import scripting.npc.NPCScriptManager;
import server.*;
import server.Timer;
import server.achievement.MapleAchievements;
import server.carnival.MapleCarnivalChallenge;
import server.carnival.MapleCarnivalParty;
import server.cashshop.CashShop;
import server.commands.PlayerGMRank;
import server.life.*;
import server.maps.*;
import server.maps.events.Event_PyramidSubway;
import server.quest.MapleQuest;
import server.reward.RewardDropEntry;
import server.shop.MapleShop;
import server.shop.MapleShopItem;
import server.shops.HiredFisher;
import server.shops.IMaplePlayerShop;
import tools.*;
import tools.data.output.MaplePacketLittleEndianWriter;
import tools.packet.*;

import java.awt.*;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;


/*       */ public class MapleCharacter extends AnimatedMapleMapObject implements Serializable {
    /*    78 */   private static final Logger log = LogManager.getLogger(MapleCharacter.class);
    private static final long serialVersionUID = 845748950829L;
    /*    79 */   private final List<MapleProcess> Process = new LinkedList<>();
    /*    80 */   private final AtomicInteger cMapCount = new AtomicInteger(1);
    /*       */
    /*    82 */   private final AtomicLong exp = new AtomicLong();
    /*    83 */   private final AtomicLong meso = new AtomicLong();
    /*    84 */   private final List<Long> killmonsterExps = new ArrayList<>();
    /*    85 */   private final transient PlayerObservable playerObservable = new PlayerObservable(this);
    private String name;
    private String chalktext;
    private String BlessOfFairy_Origin;
    private String BlessOfEmpress_Origin;
    private String teleportname;
    /*    86 */   private String chairMsg = "";
    private long lastfametime;
    private long keydown_skill;
    private long nextConsume;
    private long pqStartTime;
    private long lastDragonBloodTime;
    private long lastBerserkTime;
    private long lastRecoveryTime;
    private long lastSummonTime;
    private long mapChangeTime;
    private long lastFishingTime;
    private long lastFairyTime;
    private long lastmonsterCombo;
    private long lastHPTime;
    private long lastMPTime;
    private long lastExpirationTime;
    private long lastBlessOfDarknessTime;
    private long lastRecoveryTimeEM;
    private long lastCritStorageTime;
    private long lastForceTime;
    private long lastAegisTime;
    private byte gmLevel;
    private byte accountGender;
    private byte gender;
    /*       */   private byte initialSpawnPoint;
    /*       */   private byte skinColor;
    /*    89 */   private byte guildrank = 5;
    private byte allianceRank = 5;
    private byte world;
    private byte fairyExp;
    private byte subcategory;
    private byte hairBaseColor = -1;
    private byte hairProbColor;
    private byte hairMixedColor;
    private short mulung_energy;
    private short fatigue;
    private short hpApUsed;
    private short job;
    private short remainingAp;
    private short scrolledPosition;
    private short availableCP;
    private short totalCP;
    private int accountid;
    private int id;
    private int hair;
    private int face;
    private int mapid;
    private int fame;
    private int pvpExp;
    private int pvpPoints;
    private int totalWins;
    private int totalLosses;
    private int hitcountbat;
    /*       */   private int batcount;
    /*    91 */   private int guildid = 0;
    private int fallcounter;
    private int chair;
    private int chairType;
    private int itemEffect;
    private int itemEffectType;
    private int points;
    private int vpoints;
    private int criticalgrowth;
    private int rank = 1;
    private int rankMove = 0;
    private int jobRank = 1;
    private int jobRankMove = 0;
    private int marriageId;
    private int marriageItemId;
    private int touchedrune;
    private int monsterCombo;
    private int currentrep;
    private int totalrep;
    private int coconutteam;
    private int followid;
    private int gachexp;
    private int challenge;
    private int guildContribution = 0;
    private int todayonlinetime;
    private int totalonlinetime;
    private int weaponPoint = -1;
    private int level;
    private long chairMeso;
    private Point old;
    /*       */   private int[] wishlist;
    /*       */   private int[] rocks;
    /*       */   private int[] savedLocations;
    /*       */   private int[] regrocks;
    /*       */   private int[] hyperrocks;
    /*    97 */   private int[] remainingSp = new int[10];
    private transient AtomicInteger inst;
    private transient AtomicInteger insd;
    private transient AtomicInteger AIFamiliarID;
    private List<Integer> lastmonthfameids;
    private List<Integer> lastmonthbattleids;
    private List<MapleDoor> doors;
    private List<MechDoor> mechDoors;
    private MaplePet[] spawnPets;
    /*       */   private transient List<MapleShopItem> rebuy;
    /*       */   private MapleImp[] imps;
    /*       */   private transient Set<MapleMonster> controlled;
    /*       */   private transient Set<MapleMapObject> visibleMapObjects;
    /*       */   private transient ReentrantReadWriteLock visibleMapObjectsLock;
    /*       */   private transient ReentrantReadWriteLock summonsLock;
    /*       */   private transient ReentrantReadWriteLock controlledLock;
    /*       */   private transient ReentrantReadWriteLock itemLock;
    /*       */   private transient ReentrantReadWriteLock addhpmpLock;
    /*       */   private transient Lock rLCheck;
    /*       */   private transient MapleAndroid android;
    /*       */   private Map<Integer, MapleQuestStatus> quests;
    /*       */   private Map<Integer, String> questinfo;
    /*       */   private Map<String, String> keyValue;
    /*       */   private Map<Integer, SkillEntry> skills;
    /*       */   private Map<Integer, SkillEntry> linkSkills;
    /*       */   private Map<Integer, Pair<Integer, SkillEntry>> sonOfLinkedSkills;
    /*       */   private InnerSkillEntry[] innerSkills;
    /*       */   private MaplePlayerBuffManager buffManager;
    /*       */   private transient ArrayList<Pair<MapleBuffStat, MapleBuffStatValueHolder>> effects;
    /*       */   private transient Map<Integer, MapleCoolDownValueHolder> coolDowns;
    /*       */   private transient Map<MapleDisease, MapleDiseaseValueHolder> diseases;
    /*       */   private transient List<MapleSummon> summons;
    /*       */   private Map<ReportType, Integer> reports;
    /*       */   private CashShop cs;
    /*       */   private BuddyList buddylist;
    /*       */   private MonsterBook monsterbook;
    /*       */   private transient CheatTracker anticheat;
    /*       */   private transient MapleLieDetector antiMacro;
    /*       */   private transient MapleClient client;
    /*       */   private transient MapleParty party;
    /*       */   private PlayerStats stats;
    /*       */   private MapleCharacterCards characterCard;
    /*       */   private transient MapleMap map;
    /*       */   private transient MapleShop shop;
    /*       */   private transient MapleDragon dragon;
    /*       */   private transient MapleExtractor extractor;
    /*       */   private transient RockPaperScissors rps;
    /*       */   private transient MapleLittleWhite lw;
    /*       */   private MapleStorage storage;
    /*       */   private transient MapleTrade trade;
    /*       */   private MapleMount mount;
    /*       */   private List<Integer> finishedAchievements;
    /*       */   private MapleMessenger messenger;
    /*       */   private short[] petStore;
    /*       */   private transient IMaplePlayerShop playerShop;
    /*       */   private boolean invincible;
    /*       */   private boolean canTalk;
    /*       */   private boolean followinitiator;
    /*       */   private boolean followon;
    /*       */   private boolean smega;
    /*       */   private boolean hasSummon;
    /*       */   private MapleGuildCharacter mgc;
    /*       */   private MapleFamilyCharacter mfc;
    /*       */   private transient EventInstanceManager eventInstance;
    /*       */   private MapleInventory[] inventory;
    /*   154 */   private SkillMacro[] skillMacros = new SkillMacro[5];
    /*       */   private EnumMap<MapleTraitType, MapleTrait> traits;
    /*   156 */   private Battler[] battlers = new Battler[6];
    /*       */   private List<Battler> boxed;
    /*       */   private MapleKeyLayout keylayout;
    /*       */   private MapleQuickSlot quickslot;
    /*       */   private transient ScheduledFuture<?> mapTimeLimitTask;
    /*       */   private transient ScheduledFuture<?> chalkSchedule;
    /*       */   private transient ScheduledFuture<?> questTimeLimitTask;
    /*   163 */   private transient Event_PyramidSubway pyramidSubway = null;
    /*   164 */   private transient List<Integer> pendingExpiration = null;
    /*   165 */   private transient Map<Integer, SkillEntry> pendingSkills = null;
    private transient Map<Integer, Integer> linkMobs;
    private transient PokemonBattle battle;
    private boolean changed_wishlist;
    private boolean changed_trocklocations;
    private boolean changed_skillmacros;
    private boolean changed_achievements;
    private boolean changed_savedlocations;
    /*       */   private boolean changed_pokemon;
    /*       */   private boolean changed_questinfo;
    /*       */   private boolean changed_skills;
    /*       */   private boolean changed_reports;
    /*       */   private boolean changed_vcores;
    /*       */   private boolean changed_extendedSlots;
    /*       */   private boolean changed_innerSkills;
    /*       */   private boolean changed_keyValue;
    /*       */   private boolean changed_union;
    /*       */   private int decorate;
    /*       */   private int vip;
    /*       */   private Timestamp viptime;
    /*       */   private int titleEffect;
    /*       */   private boolean isbanned = false;
    /*       */   private int beans;
    /*       */   private int warning;
    /*       */   private int reborns;
    /*       */   private int reborns1;
    /*       */   private int reborns2;
    /*       */   private int reborns3;
    /*       */   private int apstorage;
    /*       */   private int honor;
    /*       */   private Timestamp createDate;
    /*       */   private int love;
    /*       */   private long lastlovetime;
    /*       */   private Map<Integer, Long> lastdayloveids;
    /*       */   private int playerPoints;
    /*       */   private int playerEnergy;
    /*       */   private transient MaplePvpStats pvpStats;
    /*       */   private int pvpDeaths;
    /*       */   private int pvpKills;
    /*       */   private int pvpVictory;
    /*       */   private MaplePotionPot potionPot;
    /*       */   private MapleCoreAura coreAura;
    /*       */   private boolean isSaveing;
    /*       */   private PlayerSpecialStats specialStats;
    /*       */   private Timestamp todayonlinetimestamp;
    /*       */   private int mobKills;
    /*       */   private long lastMobKillTime;
    /*   205 */   private transient Element elements = null;
    /*       */
    /*       */   private long lastRepeatEffectTime;
    /*       */
    /*       */   private int flameMapId;
    /*   210 */   private Point flamePoint = null;
    /*       */
    /*       */
    /*       */   private long totDamageToMob;
    /*       */
    /*       */
    /*       */   private long lastFuWenTime;
    /*       */
    /*       */   private transient ModifyItemPotential ItemPotential;
    /*       */
    /*       */   private int lastAttackSkillId;
    /*       */
    /*       */   private long checkPartyPassiveTime;
    /*       */
    /*       */   private int attackHit;
    /*       */
    /*   226 */   private long lasttime = 0L;
    /*   227 */   private long currenttime = 0L;
    /*   228 */   private long deadtime = 300L;
    /*       */
    /*       */   private transient ScheduledFuture<?> celebrityCrit;
    /*       */
    /*       */   private boolean luckymoney = false;
    /*       */
    /*       */   private transient Channel chatSession;
    /*       */
    /*       */   private Map<String, Integer> credit;
    /*   237 */   private short soulcount = 0;
    /*       */
    /*       */   private long lastCheckProcess;
    /*       */   private int friendshiptoadd;
    /*   241 */   private int[] friendshippoints = new int[5];
    /*       */
    /*       */   private MapleSigninStatus siginStatus;
    /*       */
    /*       */   private List<Integer> effectSwitch;
    /*       */
    /*   247 */   private Long lastSavetime = Long.valueOf(0L);
    /*       */
    /*       */   private Map<Integer, MonsterFamiliar> familiars;
    /*       */   private MonsterFamiliarObj summonedFamiliar;
    /*       */   private long logintime;
    /*       */   private long onlineTime;
    /*   253 */   private WeakReference<MapleReactor> reactor = new WeakReference<>(null);
    /*       */   private transient MapleCarnivalParty carnivalParty;
    /*       */   private transient Deque<MapleCarnivalChallenge> pendingCarnivalRequests;
    /*   256 */   private int reviveCount = -1;
    /*       */   private boolean attclimit = false;
    /*       */   private List<Integer> damSkinList;
    /*       */   private int transWarpTicket;
    /*       */   private Map<Byte, List<Integer>> extendedSlots;
    /*   261 */   private long ltime = 0L;
    /*       */
    /*       */   private transient int enchant;
    /*       */
    /*   265 */   private transient long lastUseVSkillTime = 0L;
    /*   266 */   private transient long lastUseSkillTime = 0L;
    /*   267 */   private transient Map<Integer, Long> lastUseSkillTimeExt = new HashMap<>();
    /*   268 */   private int buffValue = 0;
    /*   269 */   private long lastComboTime = 0L;
    /*       */
    /*       */   private HiredFisher hiredFisher;
    /*   272 */   private int cyzjbufftime = -1;
    /*       */
    /*       */
    /*   275 */   private int XSmobOID = 0;
    /*       */
    /*       */   private MapleUnion mapleUnion;
    /*       */
    /*       */   private transient int lastSkill;
    /*       */
    /*       */   private transient ScheduledFuture<?> godSchedule;
    /*       */
    /*       */   private boolean changed_familiars;
    /*       */
    /*   285 */   private final AtomicInteger vCoreSkillIndex = new AtomicInteger(0);
    /*       */
    /*       */   private Map<Integer, VCoreSkillEntry> vCoreSkills;
    /*       */   private Map<Integer, VMatrixSlotEntry> vMatrixSlots;
    /*       */   private int chairMode;
    /*   290 */   private int[] chairMask = new int[5];
    /*       */
    /*       */   private transient List<Triple<Integer, Long, Point>> evanWreckages;
    /*   293 */   private final Pair<MapScriptMethods.MapScriptType, String> mapScript = new Pair(MapScriptMethods.MapScriptType.UNK, "");

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    private MapleCharacter(boolean ChannelServer) {
        /*   300 */
        setStance(0);
        /*   301 */
        setPosition(new Point(0, 0));
        /*   302 */
        this.inventory = new MapleInventory[(MapleInventoryType.values()).length];
        /*   303 */
        for (MapleInventoryType type : MapleInventoryType.values()) {
            /*   304 */
            this.inventory[type.ordinal()] = new MapleInventory(type);
            /*       */
        }
        /*   306 */
        this.keyValue = new LinkedHashMap<>();
        /*   307 */
        this.questinfo = new LinkedHashMap<>();
        /*   308 */
        this.quests = new LinkedHashMap<>();
        /*   309 */
        this.skills = new LinkedHashMap<>();
        /*   310 */
        this.linkSkills = new LinkedHashMap<>();
        /*   311 */
        this.sonOfLinkedSkills = new LinkedHashMap<>();
        /*   312 */
        this.innerSkills = new InnerSkillEntry[3];
        /*   313 */
        this.stats = new PlayerStats();
        /*   314 */
        this.characterCard = new MapleCharacterCards();
        int i;
        /*   315 */
        for (i = 0; i < this.remainingSp.length; i++) {
            /*   316 */
            this.remainingSp[i] = 0;
            /*       */
        }
        /*   318 */
        this.traits = new EnumMap<>(MapleTraitType.class);
        /*   319 */
        for (MapleTraitType t : MapleTraitType.values()) {
            /*   320 */
            this.traits.put(t, new MapleTrait(t));
            /*       */
        }
        /*   322 */
        this.spawnPets = new MaplePet[3];
        /*   323 */
        this.specialStats = new PlayerSpecialStats();
        /*   324 */
        this.specialStats.resetSpecialStats();
        /*   325 */
        this.familiars = new TreeMap<>();
        /*   326 */
        this.damSkinList = new ArrayList<>();
        /*   327 */
        if (ChannelServer) {
            /*   328 */
            this.isSaveing = false;
            /*   329 */
            this.changed_reports = false;
            /*   330 */
            this.changed_skills = false;
            /*   331 */
            this.changed_achievements = false;
            /*   332 */
            this.changed_wishlist = false;
            /*   333 */
            this.changed_trocklocations = false;
            /*   334 */
            this.changed_skillmacros = false;
            /*   335 */
            this.changed_savedlocations = false;
            /*   336 */
            this.changed_pokemon = false;
            /*   337 */
            this.changed_extendedSlots = false;
            /*   338 */
            this.changed_questinfo = false;
            /*   339 */
            this.changed_innerSkills = false;
            /*   340 */
            this.changed_keyValue = false;
            /*   341 */
            this.changed_vcores = false;
            /*   342 */
            this.changed_familiars = false;
            /*   343 */
            this.scrolledPosition = 0;
            /*   344 */
            this.criticalgrowth = 0;
            /*   345 */
            this.mulung_energy = 0;
            /*   346 */
            this.keydown_skill = 0L;
            /*   347 */
            this.nextConsume = 0L;
            /*   348 */
            this.pqStartTime = 0L;
            /*   349 */
            this.fairyExp = 0;
            /*   350 */
            this.mapChangeTime = 0L;
            /*   351 */
            this.lastmonsterCombo = 0L;
            /*   352 */
            this.monsterCombo = 0;
            /*   353 */
            this.lastRecoveryTime = 0L;
            /*   354 */
            this.lastDragonBloodTime = 0L;
            /*   355 */
            this.lastBerserkTime = 0L;
            /*   356 */
            this.lastFishingTime = 0L;
            /*   357 */
            this.lastFairyTime = 0L;
            /*   358 */
            this.lastHPTime = 0L;
            /*   359 */
            this.lastMPTime = 0L;
            /*   360 */
            this.lastExpirationTime = 0L;
            /*   361 */
            this.lastBlessOfDarknessTime = 0L;
            /*   362 */
            this.lastRecoveryTimeEM = 0L;
            /*   363 */
            this.lastRepeatEffectTime = 0L;
            /*   364 */
            this.lastCritStorageTime = 0L;
            /*   365 */
            this.old = new Point(0, 0);
            /*   366 */
            this.coconutteam = 0;
            /*   367 */
            this.followid = 0;
            /*   368 */
            this.marriageItemId = 0;
            /*   369 */
            this.fallcounter = 0;
            /*   370 */
            this.challenge = 0;
            /*   371 */
            this.lastSummonTime = 0L;
            /*   372 */
            this.hasSummon = false;
            /*   373 */
            this.invincible = false;
            /*   374 */
            this.canTalk = true;
            /*   375 */
            this.followinitiator = false;
            /*   376 */
            this.followon = false;
            /*   377 */
            this.rebuy = new ArrayList<>();
            /*   378 */
            this.linkMobs = new HashMap<>();
            /*   379 */
            this.finishedAchievements = new ArrayList<>();
            /*   380 */
            this.reports = new EnumMap<>(ReportType.class);
            /*   381 */
            this.teleportname = "";
            /*   382 */
            this.smega = true;
            /*   383 */
            this.petStore = new short[3];
            /*   384 */
            for (i = 0; i < this.petStore.length; i++) {
                /*   385 */
                this.petStore[i] = -1;
                /*       */
            }
            /*   387 */
            this.wishlist = new int[12];
            /*   388 */
            this.rocks = new int[10];
            /*   389 */
            this.regrocks = new int[5];
            /*   390 */
            this.hyperrocks = new int[13];
            /*   391 */
            this.imps = new MapleImp[3];
            /*   392 */
            this.friendshippoints = new int[5];
            /*   393 */
            this.boxed = new ArrayList<>();
            /*   394 */
            this.extendedSlots = new HashMap<>();
            /*   395 */
            this.effects = new ArrayList<>();
            /*   396 */
            this.coolDowns = new LinkedHashMap<>();
            /*   397 */
            this.diseases = (Map<MapleDisease, MapleDiseaseValueHolder>) new ConcurrentEnumMap(MapleDisease.class);
            /*   398 */
            this.inst = new AtomicInteger(0);
            /*   399 */
            this.insd = new AtomicInteger(-1);
            /*   400 */
            this.AIFamiliarID = new AtomicInteger(1);
            /*   401 */
            this.keylayout = new MapleKeyLayout();
            /*   402 */
            this.quickslot = new MapleQuickSlot();
            /*   403 */
            this.doors = new ArrayList<>();
            /*   404 */
            this.mechDoors = new ArrayList<>();
            /*   405 */
            this.itemLock = new ReentrantReadWriteLock();
            /*   406 */
            this.rLCheck = this.itemLock.readLock();
            /*   407 */
            this.controlled = new LinkedHashSet<>();
            /*   408 */
            this.controlledLock = new ReentrantReadWriteLock();
            /*   409 */
            this.summons = new LinkedList<>();
            /*   410 */
            this.summonsLock = new ReentrantReadWriteLock();
            /*   411 */
            this.visibleMapObjects = new LinkedHashSet<>();
            /*   412 */
            this.visibleMapObjectsLock = new ReentrantReadWriteLock();
            /*   413 */
            this.addhpmpLock = new ReentrantReadWriteLock();
            /*       */
            /*   415 */
            this.savedLocations = new int[(SavedLocationType.values()).length];
            /*   416 */
            for (i = 0; i < (SavedLocationType.values()).length; i++) {
                /*   417 */
                this.savedLocations[i] = -1;
                /*       */
            }
            /*   419 */
            this.todayonlinetimestamp = new Timestamp(System.currentTimeMillis());
            /*   420 */
            this.buffManager = new MaplePlayerBuffManager(getName());
            /*   421 */
            this.credit = new LinkedHashMap<>();
            /*   422 */
            this.effectSwitch = new ArrayList<>();
            /*   423 */
            this.pendingCarnivalRequests = new LinkedList<>();
            /*   424 */
            this.vCoreSkills = new LinkedHashMap<>();
            /*   425 */
            this.vMatrixSlots = new TreeMap<>();
            /*   426 */
            this.evanWreckages = new ArrayList<>();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public static MapleCharacter getDefault(MapleClient client, JobType type) {
        /*   434 */
        MapleCharacter ret = new MapleCharacter(false);
        /*   435 */
        ret.client = client;
        /*   436 */
        ret.map = null;
        /*   437 */
        ret.exp.set(0L);
        /*   438 */
        ret.gmLevel = 0;
        /*   439 */
        ret.job = (short) type.jobId;
        /*   440 */
        ret.meso.set(10000L);
        /*   441 */
        ret.level = 1;
        /*   442 */
        ret.remainingAp = 0;
        /*   443 */
        ret.fame = 0;
        /*   444 */
        ret.love = 0;
        /*   445 */
        ret.accountid = client.getAccID();
        /*   446 */
        ret.buddylist = new BuddyList((byte) 20);
        /*       */
        /*   448 */
        ret.stats.str = 12;
        /*   449 */
        ret.stats.dex = 5;
        /*   450 */
        ret.stats.int_ = 4;
        /*   451 */
        ret.stats.luk = 4;
        /*   452 */
        ret.stats.maxhp = 50;
        /*   453 */
        ret.stats.hp = 50;
        /*   454 */
        ret.stats.maxmp = 50;
        /*   455 */
        ret.stats.mp = 50;
        /*   456 */
        ret.gachexp = 0;
        /*   457 */
        ret.friendshiptoadd = 0;
        /*   458 */
        ret.friendshippoints = new int[]{0, 0, 0, 0, 0};
        /*       */
        /*   460 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*   461 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM accounts WHERE id = ?");
            /*   462 */
            ps.setInt(1, ret.accountid);
            /*   463 */
            ResultSet rs = ps.executeQuery();
            /*       */
            /*   465 */
            if (rs.next()) {
                /*   466 */
                ret.client.setAccountName(rs.getString("name"));
                /*   467 */
                ret.accountGender = rs.getByte("gender");
                /*   468 */
                ret.points = rs.getInt("points");
                /*   469 */
                ret.vpoints = rs.getInt("vpoints");
                /*       */
            }
            /*   471 */
            rs.close();
            /*   472 */
            ps.close();
            /*   473 */
        } catch (SQLException e) {
            /*   474 */
            System.err.println("Error getting character default" + e);
            /*       */
        }
        /*   476 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public static MapleCharacter ReconstructChr(CharacterTransfer ct, MapleClient client, boolean isChannel) {
        /*   480 */
        MapleCharacter ret = new MapleCharacter(true);
        /*   481 */
        ret.client = client;
        /*   482 */
        if (client != null) {
            /*   483 */
            client.setAccID(ct.accountid);
            /*   484 */
            client.setAccountName(ct.accountname);
            /*   485 */
            client.setTempIP(ct.tempIP);
            /*       */
        }
        /*   487 */
        if (!isChannel && client != null) {
            /*   488 */
            ret.client.setChannel(ct.channel);
            /*       */
        }
        /*   490 */
        ret.id = ct.characterid;
        /*   491 */
        ret.name = ct.name;
        /*   492 */
        ret.level = ct.level;
        /*   493 */
        ret.fame = ct.fame;
        /*   494 */
        ret.love = ct.love;
        /*       */
        /*   496 */
        ret.stats.str = ct.str;
        /*   497 */
        ret.stats.dex = ct.dex;
        /*   498 */
        ret.stats.int_ = ct.int_;
        /*   499 */
        ret.stats.luk = ct.luk;
        /*   500 */
        ret.stats.maxhp = ct.maxhp;
        /*   501 */
        ret.stats.maxmp = ct.maxmp;
        /*   502 */
        ret.stats.hp = ct.hp;
        /*   503 */
        ret.stats.mp = ct.mp;
        /*       */
        /*   505 */
        ret.chalktext = ct.chalkboard;
        /*   506 */
        ret.gmLevel = ct.gmLevel;
        /*   507 */
        ret.exp.set((ret.level > ret.getMaxLevelForSever()) ? 0L : ct.exp);
        /*   508 */
        ret.hpApUsed = ct.hpApUsed;
        /*   509 */
        ret.remainingSp = ct.remainingSp;
        /*   510 */
        ret.remainingAp = ct.remainingAp;
        /*   511 */
        ret.meso.set(ct.meso);
        /*   512 */
        ret.skinColor = ct.skinColor;
        /*   513 */
        ret.accountGender = ct.accountGender;
        /*   514 */
        ret.gender = ct.gender;
        /*   515 */
        ret.job = ct.job;
        /*   516 */
        ret.hair = ct.hair;
        /*   517 */
        ret.hairBaseColor = ct.hairBaseColor;
        /*   518 */
        ret.hairMixedColor = ct.hairMixedColor;
        /*   519 */
        ret.hairProbColor = ct.hairProbColor;
        /*   520 */
        ret.face = ct.face;
        /*   521 */
        ret.accountid = ct.accountid;
        /*   522 */
        ret.totalWins = ct.totalWins;
        /*   523 */
        ret.totalLosses = ct.totalLosses;
        /*   524 */
        ret.mapid = ct.mapid;
        /*   525 */
        ret.initialSpawnPoint = ct.initialSpawnPoint;
        /*   526 */
        ret.world = ct.world;
        /*   527 */
        ret.guildid = ct.guildid;
        /*   528 */
        ret.guildrank = ct.guildrank;
        /*   529 */
        ret.guildContribution = ct.guildContribution;
        /*   530 */
        ret.allianceRank = ct.alliancerank;
        /*   531 */
        ret.points = ct.points;
        /*   532 */
        ret.vpoints = ct.vpoints;
        /*   533 */
        ret.fairyExp = ct.fairyExp;
        /*   534 */
        ret.marriageId = ct.marriageId;
        /*   535 */
        ret.currentrep = ct.currentrep;
        /*   536 */
        ret.totalrep = ct.totalrep;
        /*   537 */
        ret.gachexp = ct.gachexp;
        /*   538 */
        ret.pvpExp = ct.pvpExp;
        /*   539 */
        ret.pvpPoints = ct.pvpPoints;
        /*   540 */
        ret.decorate = ct.decorate;
        /*   541 */
        ret.beans = ct.beans;
        /*   542 */
        ret.warning = ct.warning;
        /*       */
        /*   544 */
        ret.reborns = ct.reborns;
        /*   545 */
        ret.reborns1 = ct.reborns1;
        /*   546 */
        ret.reborns2 = ct.reborns2;
        /*   547 */
        ret.reborns3 = ct.reborns3;
        /*   548 */
        ret.apstorage = ct.apstorage;
        /*       */
        /*   550 */
        ret.honor = ct.honor;
        /*       */
        /*   552 */
        ret.vip = ct.vip;
        /*   553 */
        ret.viptime = ct.viptime;
        /*   554 */
        ret.playerPoints = ct.playerPoints;
        /*   555 */
        ret.playerEnergy = ct.playerEnergy;
        /*   556 */
        ret.pvpDeaths = ct.pvpDeaths;
        /*   557 */
        ret.pvpKills = ct.pvpKills;
        /*   558 */
        ret.pvpVictory = ct.pvpVictory;
        /*   559 */
        ret.makeMFC(ct.familyid, ct.seniorid, ct.junior1, ct.junior2);
        /*   560 */
        if (ret.guildid > 0) {
            /*   561 */
            ret.mgc = new MapleGuildCharacter(ret);
            /*       */
        }
        /*   563 */
        ret.fatigue = ct.fatigue;
        /*   564 */
        ret.buddylist = new BuddyList(ct.buddysize);
        /*   565 */
        ret.subcategory = ct.subcategory;
        /*   566 */
        ret.friendshiptoadd = ct.friendshiptoadd;
        /*   567 */
        ret.friendshippoints = ct.friendshippoints;
        /*   568 */
        ret.soulcount = ct.soulcount;
        /*   569 */
        ret.inventory = ct.inventorys;
        /*   570 */
        ret.ltime = ct.ltime;
        /*       */
        /*   572 */
        int messengerid = ct.messengerid;
        /*   573 */
        if (messengerid > 0) {
            /*   574 */
            ret.messenger = WorldMessengerService.getInstance().getMessenger(messengerid);
            /*       */
        }
        /*   576 */
        int partyid = ct.partyid;
        /*   577 */
        if (partyid >= 0) {
            /*   578 */
            MapleParty party = WorldPartyService.getInstance().getParty(partyid);
            /*   579 */
            if (party != null && party.getMemberById(ret.id) != null) {
                /*   580 */
                ret.party = party;
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*   585 */
        for (Map.Entry<Integer, MapleQuestStatus> qs : (Iterable<Map.Entry<Integer, MapleQuestStatus>>) ct.Quest.entrySet()) {
            /*   586 */
            MapleQuestStatus queststatus_from = qs.getValue();
            /*   587 */
            queststatus_from.setQuest(((Integer) qs.getKey()).intValue());
            /*   588 */
            ret.quests.put(qs.getKey(), queststatus_from);
            /*       */
        }
        /*   590 */
        for (Map.Entry<Integer, SkillEntry> qs : (Iterable<Map.Entry<Integer, SkillEntry>>) ct.skills.entrySet()) {
            /*   591 */
            ret.skills.put(qs.getKey(), qs.getValue());
            /*   592 */
            if (SkillConstants.isLinkSkills(((Integer) qs.getKey()).intValue()) && ret.linkSkills.size() < 12) {
                /*   593 */
                ret.linkSkills.put(qs.getKey(), qs.getValue());
                /*       */
            }
            /*       */
        }
        /*   596 */
        ret.finishedAchievements.addAll(ct.finishedAchievements);
        /*   597 */
        for (Battler zz : ct.boxed) {
            /*   598 */
            zz.setStats();
            /*   599 */
            ret.boxed.add(zz);
            /*       */
        }
        /*   601 */
        for (Map.Entry<MapleTraitType, Integer> t : (Iterable<Map.Entry<MapleTraitType, Integer>>) ct.traits.entrySet()) {
            /*   602 */
            ((MapleTrait) ret.traits.get(t.getKey())).setExp(((Integer) t.getValue()).intValue());
            /*       */
        }
        /*   604 */
        for (Map.Entry<Byte, Integer> qs : (Iterable<Map.Entry<Byte, Integer>>) ct.reports.entrySet()) {
            /*   605 */
            ret.reports.put(ReportType.getById(((Byte) qs.getKey()).byteValue()), qs.getValue());
            /*       */
        }
        /*   607 */
//        ct.sonOfLinedSkills.forEach((key, value) -> (Pair) ret.sonOfLinkedSkills.put(key, value));
        /*   608 */
        for (Map.Entry<Integer, VCoreSkillEntry> vse : (Iterable<Map.Entry<Integer, VCoreSkillEntry>>) ct.vcoreskills.entrySet()) {
            /*   609 */
            if (((VCoreSkillEntry) vse.getValue()).getSlot() > 0) {
                /*   610 */
                ret.vCoreSkills.put(Integer.valueOf(ret.vCoreSkillIndex.getAndIncrement()), vse.getValue());
                /*       */
            }
            /*       */
        }
        /*   613 */
        ret.vMatrixSlots = ct.vMatrixslots;
        /*   614 */
        ret.innerSkills = ct.innerSkills;
        /*   615 */
        ret.monsterbook = new MonsterBook(ct.mbook, ret);
        /*   616 */
        ret.BlessOfFairy_Origin = ct.BlessOfFairy;
        /*   617 */
        ret.BlessOfEmpress_Origin = ct.BlessOfEmpress;
        /*   618 */
        ret.skillMacros = ct.skillmacro;
        /*   619 */
        ret.battlers = ct.battlers;
        /*   620 */
        for (Battler b : ret.battlers) {
            /*   621 */
            if (b != null) {
                /*   622 */
                b.setStats();
                /*       */
            }
            /*       */
        }
        /*   625 */
        ret.petStore = ct.petStore;
        /*   626 */
        ret.keylayout = new MapleKeyLayout(ct.keymap);
        /*   627 */
        ret.quickslot = new MapleQuickSlot(ct.quickslot);
        /*   628 */
        ret.keyValue = ct.KeyValue;
        /*   629 */
        ret.questinfo = ct.InfoQuest;
        /*   630 */
        ret.savedLocations = ct.savedlocation;
        /*   631 */
        ret.wishlist = ct.wishlist;
        /*   632 */
        ret.rocks = ct.rocks;
        /*   633 */
        ret.regrocks = ct.regrocks;
        /*   634 */
        ret.hyperrocks = ct.hyperrocks;
        /*   635 */
        ret.buddylist.loadFromTransfer(ct.buddies);
        /*       */
        /*       */
        /*   638 */
        ret.keydown_skill = 0L;
        /*   639 */
        ret.lastfametime = ct.lastfametime;
        /*   640 */
        ret.lastmonthfameids = ct.famedcharacters;
        /*   641 */
        ret.lastmonthbattleids = ct.battledaccs;
        /*   642 */
        ret.extendedSlots = ct.extendedSlots;
        /*   643 */
        ret.lastlovetime = ct.lastLoveTime;
        /*   644 */
        ret.lastdayloveids = ct.loveCharacters;
        /*   645 */
        ret.storage = ct.storage;
        /*   646 */
        ret.pvpStats = ct.pvpStats;
        /*   647 */
        ret.potionPot = ct.potionPot;
        /*   648 */
        ret.coreAura = ct.coreAura;
        /*   649 */
        ret.specialStats = ct.SpecialStats;
        /*   650 */
        ret.cs = ct.cs;
        /*   651 */
        ret.imps = ct.imps;
        /*   652 */
        ret.anticheat = ct.anticheat;
        /*   653 */
        ret.anticheat.start(Integer.valueOf(ret.getId()));
        /*   654 */
        ret.antiMacro = ct.antiMacro;
        /*   655 */
        ret.rebuy = ct.rebuy;
        /*   656 */
        ret.mount = new MapleMount(ret, ct.mount_itemid, PlayerStats.getSkillByJob(1004, ret.job), ct.mount_Fatigue, ct.mount_level, ct.mount_exp);
        /*   657 */
        ret.todayonlinetime = ct.todayonlinetime;
        /*   658 */
        ret.totalonlinetime = ct.totalonlinetime;
        /*   659 */
        ret.weaponPoint = ct.weaponPoint;
        /*   660 */
        ret.credit = ct.credit;
        /*   661 */
        ret.effectSwitch = ct.effectSwitch;
        /*   662 */
        ret.familiars = ct.familiars;
        /*   663 */
        ret.mapleUnion = ct.mapleUnion;
        /*   664 */
        ret.changed_vcores = ct.changed_vcores;
        /*   665 */
        ret.changed_familiars = ct.changed_familiars;
        /*   666 */
        ret.summonedFamiliar = ct.summonedFamiliar;
        /*   667 */
        ret.AIFamiliarID = new AtomicInteger(ct.atFamiliarID);
        /*       */
        /*   669 */
        if (isChannel) {
            /*       */
            /*       */
            /*   672 */
            MapleMapFactory mapFactory = ChannelServer.getInstance(client.getChannel()).getMapFactory();
            /*   673 */
            ret.map = mapFactory.getMap(ret.mapid);
            /*   674 */
            if (ret.map == null) {
                /*   675 */
                ret.map = mapFactory.getMap(100000000);
                /*   676 */
            } else if (ret.map.getForcedReturnId() != 999999999 && ret.map.getForcedReturnMap() != null) {
                /*   677 */
                ret.map = ret.map.getForcedReturnMap();
                /*       */
            }
            /*   679 */
            MaplePortal portal = ret.map.getPortal(ret.initialSpawnPoint);
            /*   680 */
            if (portal == null) {
                /*   681 */
                portal = ret.map.getPortal(0);
                /*   682 */
                ret.initialSpawnPoint = 0;
                /*       */
            }
            /*   684 */
            ret.setPosition(portal.getPosition());
            /*   685 */
            ret.characterCard.loadCards(client, true);
            /*   686 */
            ret.stats.recalcLocalStats(true, ret);
            /*       */
        } else {
            /*   688 */
            ret.messenger = null;
            /*       */
        }
        /*       */
        /*       */
        /*   692 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public static MapleCharacter loadCharFromDB(int charid, MapleClient client, boolean channelserver) {
        /*   699 */
        return loadCharFromDB(charid, client, channelserver, (Map<Integer, CardData>) null);
        /*       */
    }

    /*       */
    /*       */
    public static MapleCharacter loadCharFromDB(int charid, MapleClient client, boolean channelserver, Map<Integer, CardData> cads) {
        /*   703 */
        MapleCharacter ret = new MapleCharacter(channelserver);
        /*   704 */
        ret.client = client;
        /*   705 */
        ret.id = charid;
        /*       */
        /*   707 */
        PreparedStatement ps = null;
        /*       */
        /*   709 */
        ResultSet rs = null;
        /*       */
        /*   711 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*   712 */
            ps = con.prepareStatement("SELECT * FROM characters WHERE id = ?");
            /*   713 */
            ps.setInt(1, charid);
            /*   714 */
            rs = ps.executeQuery();
            /*   715 */
            if (!rs.next()) {
                /*   716 */
                rs.close();
                /*   717 */
                ps.close();
                /*   718 */
                throw new RuntimeException("加载角色失败原因(角色没有找到).");
                /*       */
            }
            /*   720 */
            ret.name = rs.getString("name");
            /*   721 */
            ret.level = rs.getShort("level");
            /*   722 */
            ret.fame = rs.getInt("fame");
            /*   723 */
            ret.love = rs.getInt("love");
            /*       */
            /*   725 */
            ret.stats.str = rs.getShort("str");
            /*   726 */
            ret.stats.dex = rs.getShort("dex");
            /*   727 */
            ret.stats.int_ = rs.getShort("int");
            /*   728 */
            ret.stats.luk = rs.getShort("luk");
            /*   729 */
            ret.job = rs.getShort("job");
            /*   730 */
            ret.stats.maxhp = rs.getInt("maxhp");
            /*   731 */
            ret.stats.maxmp = JobConstants.isNotMpJob(ret.job) ? GameConstants.getMPByJob(ret.job) : rs.getInt("maxmp");
            /*   732 */
            ret.stats.hp = rs.getInt("hp");
            /*   733 */
            ret.stats.mp = rs.getInt("mp");
            /*   734 */
            ret.gmLevel = rs.getByte("gm");
            /*   735 */
            ret.exp.set((ret.level >= ret.getMaxLevelForSever()) ? 0L : rs.getLong("exp"));
            /*   736 */
            ret.hpApUsed = rs.getShort("hpApUsed");
            /*   737 */
            String[] sp = rs.getString("sp").split(",");
            /*   738 */
            for (int i = 0; i < ret.remainingSp.length; i++) {
                /*   739 */
                ret.remainingSp[i] = Integer.parseInt(sp[i]);
                /*       */
            }
            /*   741 */
            ret.remainingAp = rs.getShort("ap");
            /*   742 */
            ret.meso.set(rs.getLong("meso"));
            /*   743 */
            ret.skinColor = rs.getByte("skincolor");
            /*   744 */
            ret.gender = rs.getByte("gender");
            /*       */
            /*       */
            /*   747 */
            int hair = rs.getInt("hair");
            /*   748 */
            int face = rs.getInt("face");
            /*   749 */
            if (!MapleItemInformationProvider.getInstance().loadHairFace(hair)) {
                /*   750 */
                hair = (ret.gender == 0) ? 30000 : 31000;
                /*       */
            }
            /*   752 */
            if (!MapleItemInformationProvider.getInstance().loadHairFace(face)) {
                /*   753 */
                face = (ret.gender == 0) ? 20000 : 21000;
                /*       */
            }
            /*   755 */
            ret.hair = hair;
            /*   756 */
            ret.face = face;
            /*   757 */
            ret.hairBaseColor = rs.getByte("basecolor");
            /*   758 */
            ret.hairMixedColor = rs.getByte("mixedcolor");
            /*   759 */
            ret.hairProbColor = rs.getByte("probcolor");
            /*       */
            /*   761 */
            ret.accountid = rs.getInt("accountid");
            /*   762 */
            if (client != null) {
                /*   763 */
                client.setAccID(ret.accountid);
                /*       */
            }
            /*   765 */
            ret.mapid = rs.getInt("map");
            /*   766 */
            ret.initialSpawnPoint = rs.getByte("spawnpoint");
            /*   767 */
            ret.world = rs.getByte("world");
            /*   768 */
            ret.guildid = rs.getInt("guildid");
            /*   769 */
            ret.guildrank = rs.getByte("guildrank");
            /*   770 */
            ret.allianceRank = rs.getByte("allianceRank");
            /*   771 */
            ret.guildContribution = rs.getInt("guildContribution");
            /*   772 */
            ret.totalWins = rs.getInt("totalWins");
            /*   773 */
            ret.totalLosses = rs.getInt("totalLosses");
            /*   774 */
            ret.currentrep = rs.getInt("currentrep");
            /*   775 */
            ret.totalrep = rs.getInt("totalrep");
            /*   776 */
            ret.makeMFC(rs.getInt("familyid"), rs.getInt("seniorid"), rs.getInt("junior1"), rs.getInt("junior2"));
            /*   777 */
            if (ret.guildid > 0 && client != null) {
                /*   778 */
                ret.mgc = new MapleGuildCharacter(ret);
                /*       */
            }
            /*   780 */
            ret.gachexp = rs.getInt("gachexp");
            /*   781 */
            ret.buddylist = new BuddyList(rs.getByte("buddyCapacity"));
            /*   782 */
            ret.subcategory = rs.getByte("subcategory");
            /*   783 */
            ret.mount = new MapleMount(ret, 0, PlayerStats.getSkillByJob(1004, ret.job), (byte) 0, (byte) 1, 0);
            /*       */
            /*   785 */
            ret.rank = rs.getInt("rank");
            /*   786 */
            ret.rankMove = rs.getInt("rankMove");
            /*   787 */
            ret.jobRank = rs.getInt("jobRank");
            /*   788 */
            ret.jobRankMove = rs.getInt("jobRankMove");
            /*       */
            /*   790 */
            ret.marriageId = rs.getInt("marriageId");
            /*       */
            /*   792 */
            ret.fatigue = rs.getShort("fatigue");
            /*       */
            /*   794 */
            ret.pvpExp = rs.getInt("pvpExp");
            /*   795 */
            ret.pvpPoints = rs.getInt("pvpPoints");
            /*       */
            /*   797 */
            for (MapleTrait t : ret.traits.values()) {
                /*   798 */
                t.setExp(rs.getInt(t.getType().name()));
                /*       */
            }
            /*       */
            /*   801 */
            ret.decorate = rs.getInt("decorate");
            /*       */
            /*   803 */
            ret.beans = rs.getInt("beans");
            /*       */
            /*   805 */
            ret.warning = rs.getInt("warning");
            /*       */
            /*   807 */
            ret.reborns = rs.getInt("reborns");
            /*   808 */
            ret.reborns1 = rs.getInt("reborns1");
            /*   809 */
            ret.reborns2 = rs.getInt("reborns2");
            /*   810 */
            ret.reborns3 = rs.getInt("reborns3");
            /*   811 */
            ret.apstorage = rs.getInt("apstorage");
            /*       */
            /*   813 */
            ret.honor = rs.getInt("honor");
            /*       */
            /*   815 */
            ret.playerPoints = rs.getInt("playerPoints");
            /*   816 */
            ret.playerEnergy = rs.getInt("playerEnergy");
            /*       */
            /*   818 */
            ret.pvpDeaths = rs.getInt("pvpDeaths");
            /*   819 */
            ret.pvpKills = rs.getInt("pvpKills");
            /*   820 */
            ret.pvpVictory = rs.getInt("pvpVictory");
            /*       */
            /*   822 */
            ret.vip = rs.getInt("vip");
            /*   823 */
            ret.viptime = rs.getTimestamp("viptime");
            /*   824 */
            ret.todayonlinetime = rs.getInt("todayonlinetime");
            /*   825 */
            ret.totalonlinetime = rs.getInt("totalonlinetime");
            /*   826 */
            ret.weaponPoint = rs.getInt("wp");
            /*   827 */
            ret.friendshiptoadd = rs.getInt("friendshiptoadd");
            /*   828 */
            String[] points = rs.getString("friendshippoints").split(",");
            int j;
            /*   829 */
            for (j = 0; j < 5; j++) {
                /*   830 */
                ret.friendshippoints[j] = Integer.parseInt(points[j]);
                /*       */
            }
            /*   832 */
            if (channelserver && client != null) {
                /*       */
                /*   834 */
                ret.pvpStats = MaplePvpStats.loadOrCreateFromDB(ret.accountid);
                /*       */
                /*   836 */
                ret.anticheat = new CheatTracker(Integer.valueOf(ret.getId()));
                /*       */
                /*   838 */
                ret.antiMacro = new MapleLieDetector(ret.getId());
                /*       */
                /*   840 */
                MapleMapFactory mapFactory = ChannelServer.getInstance(client.getChannel()).getMapFactory();
                /*   841 */
                ret.map = mapFactory.getMap(ret.mapid);
                /*   842 */
                if (ret.map == null) {
                    /*   843 */
                    ret.map = mapFactory.getMap(100000000);
                    /*       */
                }
                /*       */
                /*   846 */
                MaplePortal portal = ret.map.getPortal(ret.initialSpawnPoint);
                /*   847 */
                if (portal == null) {
                    /*   848 */
                    portal = ret.map.getPortal(0);
                    /*   849 */
                    ret.initialSpawnPoint = 0;
                    /*       */
                }
                /*   851 */
                ret.setPosition(portal.getPosition());
                /*       */
                /*   853 */
                int partyid = rs.getInt("party");
                /*   854 */
                if (partyid >= 0) {
                    /*   855 */
                    MapleParty party = WorldPartyService.getInstance().getParty(partyid);
                    /*   856 */
                    if (party != null && party.getMemberById(ret.id) != null) {
                        /*   857 */
                        ret.party = party;
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*   861 */
                String[] pets = rs.getString("pets").split(",");
                /*   862 */
                for (int k = 0; k < ret.petStore.length; k++)
                    /*       */ {
                    /*   864 */
                    ret.petStore[k] = Short.parseShort(pets[k]);
                    /*       */
                }
                /*   866 */
                rs.close();
                /*   867 */
                ps.close();
                /*       */
                /*   869 */
                ps = con.prepareStatement("SELECT * FROM achievements WHERE accountid = ?");
                /*   870 */
                ps.setInt(1, ret.accountid);
                /*   871 */
                rs = ps.executeQuery();
                /*   872 */
                while (rs.next()) {
                    /*   873 */
                    ret.finishedAchievements.add(Integer.valueOf(rs.getInt("achievementid")));
                    /*       */
                }
                /*   875 */
                ps.close();
                /*   876 */
                rs.close();
                /*       */
                /*   878 */
                ps = con.prepareStatement("SELECT * FROM reports WHERE characterid = ?");
                /*   879 */
                ps.setInt(1, charid);
                /*   880 */
                rs = ps.executeQuery();
                /*   881 */
                while (rs.next()) {
                    /*   882 */
                    if (ReportType.getById(rs.getByte("type")) != null) {
                        /*   883 */
                        ret.reports.put(ReportType.getById(rs.getByte("type")), Integer.valueOf(rs.getInt("count")));
                        /*       */
                    }
                    /*       */
                }
                /*   886 */
                ret.setLTime();
                /*       */
            }
            /*       */
            /*       */
            /*   890 */
            rs.close();
            /*   891 */
            ps.close();
            /*       */
            /*       */
            /*       */
            /*   895 */
            if (cads != null) {
                /*   896 */
                ret.characterCard.setCards(cads);
                /*   897 */
            } else if (client != null) {
                /*   898 */
                ret.characterCard.loadCards(client, channelserver);
                /*       */
            }
            /*       */
            /*   901 */
            ps = con.prepareStatement("SELECT * FROM character_keyvalue WHERE characterid = ?");
            /*   902 */
            ps.setInt(1, charid);
            /*   903 */
            rs = ps.executeQuery();
            /*   904 */
            while (rs.next()) {
                /*   905 */
                if (rs.getString("key") == null) {
                    /*       */
                    continue;
                    /*       */
                }
                /*   908 */
                ret.keyValue.put(rs.getString("key"), rs.getString("value"));
                /*       */
            }
            /*   910 */
            rs.close();
            /*   911 */
            ps.close();
            /*       */
            /*   913 */
            ps = con.prepareStatement("SELECT * FROM questinfo WHERE accountid = ? OR characterid = ?");
            /*   914 */
            ps.setInt(1, ret.accountid);
            /*   915 */
            ps.setInt(2, charid);
            /*   916 */
            rs = ps.executeQuery();
            /*   917 */
            while (rs.next()) {
                /*   918 */
                ret.questinfo.put(Integer.valueOf(rs.getInt("quest")), rs.getString("customData"));
                /*       */
            }
            /*   920 */
            rs.close();
            /*   921 */
            ps.close();
            /*       */
            /*   923 */
            ps = con.prepareStatement("SELECT * FROM queststatus WHERE characterid = ?");
            /*   924 */
            ps.setInt(1, charid);
            /*   925 */
            rs = ps.executeQuery();
            /*   926 */
            PreparedStatement pse = con.prepareStatement("SELECT * FROM queststatusmobs WHERE queststatusid = ?");
            /*   927 */
            while (rs.next()) {
                /*   928 */
                int id = rs.getInt("quest");
                /*   929 */
                MapleQuest q = MapleQuest.getInstance(id);
                /*   930 */
                byte stat = rs.getByte("status");
                /*   931 */
                if ((stat == 1 || stat == 2) && channelserver && (q == null || q.isBlocked())) {
                    /*       */
                    continue;
                    /*       */
                }
                /*   934 */
                if (stat == 1 && channelserver && !q.canStart(ret, null)) {
                    /*       */
                    continue;
                    /*       */
                }
                /*   937 */
                MapleQuestStatus status = new MapleQuestStatus(q, stat);
                /*   938 */
                long cTime = rs.getLong("time");
                /*   939 */
                if (cTime > -1L) {
                    /*   940 */
                    status.setCompletionTime(cTime * 1000L);
                    /*       */
                }
                /*   942 */
                status.setForfeited(rs.getInt("forfeited"));
                /*   943 */
                status.setCustomData(rs.getString("customData"));
                /*   944 */
                ret.quests.put(Integer.valueOf(id), status);
                /*   945 */
                pse.setInt(1, rs.getInt("queststatusid"));
                /*   946 */
                try (ResultSet rsMobs = pse.executeQuery()) {
                    /*   947 */
                    while (rsMobs.next()) {
                        /*   948 */
                        status.setMobKills(rsMobs.getInt("mob"), rsMobs.getInt("count"));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*   952 */
            rs.close();
            /*   953 */
            ps.close();
            /*   954 */
            pse.close();
            /*       */
            /*       */
            /*   957 */
            if (channelserver) {
                /*       */
                /*   959 */
                ret.monsterbook = MonsterBook.loadCards(ret.accountid, ret);
                /*       */
                /*   961 */
                ps = con.prepareStatement("SELECT * FROM inventoryslot WHERE characterid = ?");
                /*   962 */
                ps.setInt(1, charid);
                /*   963 */
                rs = ps.executeQuery();
                /*   964 */
                if (!rs.next()) {
                    /*   965 */
                    rs.close();
                    /*   966 */
                    ps.close();
                    /*   967 */
                    throw new RuntimeException("No Inventory slot column found in SQL. [inventoryslot]");
                    /*       */
                }
                /*   969 */
                ret.getInventory(MapleInventoryType.EQUIP).setSlotLimit(rs.getShort("equip"));
                /*   970 */
                ret.getInventory(MapleInventoryType.USE).setSlotLimit(rs.getShort("use"));
                /*   971 */
                ret.getInventory(MapleInventoryType.SETUP).setSlotLimit(rs.getShort("setup"));
                /*   972 */
                ret.getInventory(MapleInventoryType.ETC).setSlotLimit(rs.getShort("etc"));
                /*   973 */
                ret.getInventory(MapleInventoryType.CASH).setSlotLimit(rs.getShort("cash"));
                /*       */
                /*   975 */
                ps.close();
                /*   976 */
                rs.close();
                /*       */
                /*   978 */
                for (Pair<Item, MapleInventoryType> mit : (Iterable<Pair<Item, MapleInventoryType>>) ItemLoader.装备道具.loadItems(false, charid).values()) {
                    /*   979 */
                    ret.getInventory((MapleInventoryType) mit.getRight()).addFromDB((Item) mit.getLeft());
                    /*       */
                }
                /*       */
                /*   982 */
                ps = con.prepareStatement("SELECT * FROM accounts WHERE id = ?");
                /*   983 */
                ps.setInt(1, ret.accountid);
                /*   984 */
                rs = ps.executeQuery();
                /*   985 */
                if (rs.next()) {
                    /*   986 */
                    ret.getClient().setAccountName(rs.getString("name"));
                    /*   987 */
                    ret.points = rs.getInt("points");
                    /*   988 */
                    ret.vpoints = rs.getInt("vpoints");
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*   995 */
                    if (rs.getTimestamp("lastlogon") != null) {
                        /*   996 */
                        Calendar cal = Calendar.getInstance();
                        /*   997 */
                        cal.setTimeInMillis(rs.getTimestamp("lastlogon").getTime());
                        /*   998 */
                        if (cal.get(7) + 1 == Calendar.getInstance().get(7)) ;
                        /*       */
                    }
                    /*       */
                    /*       */
                    /*  1002 */
                    if (rs.getInt("banned") > 0) {
                        /*  1003 */
                        rs.close();
                        /*  1004 */
                        ps.close();
                        /*  1005 */
                        ret.getClient().getSession().close();
                        /*  1006 */
                        throw new RuntimeException("加载的角色为封号状态，服务端断开这个连接...");
                        /*       */
                    }
                    /*  1008 */
                    rs.close();
                    /*  1009 */
                    ps.close();
                    /*       */
                    /*  1011 */
                    ps = con.prepareStatement("UPDATE accounts SET lastlogon = CURRENT_TIMESTAMP() WHERE id = ?");
                    /*  1012 */
                    ps.setInt(1, ret.accountid);
                    /*  1013 */
                    ps.executeUpdate();
                    /*       */
                } else {
                    /*  1015 */
                    rs.close();
                    /*       */
                }
                /*  1017 */
                ps.close();
                /*       */
                /*  1019 */
                ps = con.prepareStatement("SELECT * FROM `vmatrixslot` WHERE `characters_id` = ?");
                /*  1020 */
                ps.setInt(1, ret.id);
                /*  1021 */
                rs = ps.executeQuery();
                /*  1022 */
                while (rs.next()) {
                    /*  1023 */
                    VMatrixSlotEntry vmse = new VMatrixSlotEntry();
                    /*  1024 */
                    vmse.setExtend(rs.getInt("extend"));
                    /*  1025 */
                    vmse.setSlot(rs.getInt("slot"));
                    /*  1026 */
                    vmse.setUnlock(rs.getInt("unlock"));
                    /*  1027 */
                    ret.vMatrixSlots.put(Integer.valueOf(vmse.getSlot()), vmse);
                    /*       */
                }
                /*  1029 */
                rs.close();
                /*  1030 */
                ps.close();
                /*       */
                /*  1032 */
                for (j = 0; j < VMatrixOptionBans.INSTANCE.getEquipSlotMax(); j++) {
                    /*  1033 */
                    if (!ret.vMatrixSlots.containsKey(Integer.valueOf(j))) {
                        /*  1034 */
                        ret.vMatrixSlots.put(Integer.valueOf(j), new VMatrixSlotEntry(j));
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*  1038 */
                ps = con.prepareStatement("SELECT * FROM vcoreskill WHERE characterid = ?");
                /*  1039 */
                ps.setInt(1, charid);
                /*  1040 */
                rs = ps.executeQuery();
                /*  1041 */
                while (rs.next()) {
                    /*  1042 */
                    int vcoreid = rs.getInt("vcoreid");
                    /*  1043 */
                    if (MapleItemInformationProvider.getInstance().getVcoreDatas().containsKey(Integer.valueOf(vcoreid))) {
                        /*  1044 */
                        int skill1 = rs.getInt("skill1");
                        /*  1045 */
                        int skill2 = rs.getInt("skill2");
                        /*  1046 */
                        int skill3 = rs.getInt("skill3");
                        /*  1047 */
                        if ((skill1 > 0 && SkillFactory.getSkill(skill1) == null) || (skill2 > 0 && SkillFactory.getSkill(skill2) == null) || (skill3 > 0 && SkillFactory.getSkill(skill3) == null)) {
                            /*       */
                            continue;
                            /*       */
                        }
                        /*  1050 */
                        ret.addVCoreSkill(new VCoreSkillEntry(vcoreid, rs.getInt("level"), rs.getInt("exp"), skill1, skill2, skill3, rs.getLong("dateexpire"), rs.getInt("slot"), rs.getInt("index")));
                        /*       */
                    }
                    /*       */
                }
                /*  1053 */
                rs.close();
                /*  1054 */
                ps.close();
                /*       */
                /*  1056 */
                ret.vCoreSkills.forEach((key, vCoreSkillEntry) -> {
                    /*       */
                    if (vCoreSkillEntry.getSlot() == 2) {
                        /*       */
                        VMatrixSlotEntry vMatrixSlotEntry = ret.vMatrixSlots.get(Integer.valueOf(vCoreSkillEntry.getIndex()));
                        /*       */
                        /*       */
                        if (vMatrixSlotEntry != null) {
                            /*       */
                            vMatrixSlotEntry.setIndex(key.intValue());
                            /*       */
                            for (int i = 1; i <= 3; i++) {
                                /*       */
                                int vCoreSkillID = vCoreSkillEntry.getSkill(i);
                                /*       */
                                Skill skill = SkillFactory.getSkill(vCoreSkillID);
                                /*       */
                                if (vCoreSkillID > 0 && skill != null) {
                                    /*       */
                                    SkillEntry skillEntry;
                                    /*       */
                                    if (vCoreSkillEntry.getType() == 0 || vCoreSkillEntry.getType() == 2) {
                                        /*       */
                                        if (ret.skills.containsKey(Integer.valueOf(vCoreSkillID))) {
                                            /*       */
                                            continue;
                                            /*       */
                                        }
                                        /*       */
                                        skillEntry = new SkillEntry(vCoreSkillEntry.getLevel() + vMatrixSlotEntry.getExtend(), (byte) skill.getMasterLevel(), -1L, 0, (byte) -1);
                                        /*       */
                                    } else {
                                        /*       */
                                        if (vCoreSkillEntry.getType() != 1) {
                                            /*       */
                                            continue;
                                            /*       */
                                        }
                                        /*       */
                                        if (!ret.skills.containsKey(Integer.valueOf(vCoreSkillID))) {
                                            /*       */
                                            skillEntry = new SkillEntry(vCoreSkillEntry.getLevel() + vMatrixSlotEntry.getExtend(), (byte) skill.getMasterLevel(), -1L, 0, (byte) -1);
                                            /*       */
                                        } else {
                                            /*       */
                                            skillEntry = ret.skills.get(Integer.valueOf(vCoreSkillID));
                                            /*       */
                                            skillEntry.skillevel = Math.min(skillEntry.skillevel + vCoreSkillEntry.getLevel() + vMatrixSlotEntry.getExtend(), skill.getMaxLevel());
                                            /*       */
                                        }
                                        /*       */
                                    }
                                    /*       */
                                    ret.skills.put(Integer.valueOf(vCoreSkillID), skillEntry);
                                    /*       */
                                }
                                /*       */
                                continue;
                                /*       */
                            }
                            /*       */
                        } else {
                            /*       */
                            vCoreSkillEntry.setSlot(1);
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                });
                /*  1092 */
                ps = con.prepareStatement("SELECT * FROM skills WHERE characterid = ?");
                /*  1093 */
                ps.setInt(1, charid);
                /*  1094 */
                rs = ps.executeQuery();
                /*       */
                /*  1096 */
                int phantom = 0;
                /*  1097 */
                while (rs.next()) {
                    /*  1098 */
                    int skid = rs.getInt("skillid");
                    /*  1099 */
                    Skill skil = SkillFactory.getSkill(skid);
                    /*  1100 */
                    int skl = rs.getInt("skilllevel");
                    /*  1101 */
                    byte msl = rs.getByte("masterlevel");
                    /*  1102 */
                    int teachId = rs.getInt("teachId");
                    /*  1103 */
                    byte b1 = rs.getByte("position");
                    /*  1104 */
                    if (skil != null && SkillConstants.isApplicableSkill(skid)) {
                        /*  1105 */
                        if (skil.is老技能()) {
                            /*  1106 */
                            ret.changed_skills = true;
                            /*       */
                            continue;
                            /*       */
                        }
                        /*  1109 */
                        if (skl > skil.getMaxLevel() && (skid < 92000000 || skid > 99999999)) {
                            /*  1110 */
                            if (!skil.isBeginnerSkill() && skil.canBeLearnedBy(ret.job) && !skil.isSpecialSkill() && !skil.isAdminSkill()) {
                                /*  1111 */
                                ret.remainingSp[JobConstants.getSkillBookBySkill(skid)] = ret.remainingSp[JobConstants.getSkillBookBySkill(skid)] + skl - skil.getMaxLevel();
                                /*       */
                            }
                            /*  1113 */
                            skl = (byte) skil.getMaxLevel();
                            /*       */
                        }
                        /*  1115 */
                        if (msl > skil.getMaxLevel()) {
                            /*  1116 */
                            msl = (byte) skil.getMaxLevel();
                            /*       */
                        }
                        /*  1118 */
                        if (b1 >= 0 && b1 < 15 && phantom < 15) {
                            /*  1119 */
                            if (JobConstants.is幻影(ret.job) && skil.getSkillByJobBook() != -1) {
                                /*  1120 */
                                msl = SkillConstants.isFourthJob(skid) ? (byte) skil.getMasterLevel() : 0;
                                /*  1121 */
                                ret.skills.put(Integer.valueOf(skid), new SkillEntry(skl, msl, -1L, teachId, b1));
                                /*       */
                            }
                            /*  1123 */
                            phantom++;
                            continue;
                            /*       */
                        }
                        /*  1125 */
                        if (skil.isLinkSkills() && ret.linkSkills.size() < 12) {
                            /*  1126 */
                            skl = SkillConstants.getLinkSkillslevel(skil.getMaxLevel(), skil, teachId, ret.level);
                            /*  1127 */
                            ret.linkSkills.put(Integer.valueOf(skid), new SkillEntry(skl, msl, rs.getLong("expiration"), teachId));
                            /*  1128 */
                        } else if (skil.isTeachSkills()) {
                            /*  1129 */
                            skl = SkillConstants.getLinkSkillslevel(skil.getMaxLevel(), skil, teachId, ret.level);
                            /*  1130 */
                        } else if (skil.getFixLevel() > 0) {
                            /*  1131 */
                            skl = skil.getFixLevel();
                            /*  1132 */
                        } else if (skid / 10000 >= 40000 && skid / 10000 <= 40005) {
                            /*  1133 */
                            if (ret.getVCoreSkillLevel(skid) <= 0) {
                                /*  1134 */
                                ret.changed_skills = true;
                                /*       */
                                continue;
                                /*       */
                            }
                            /*  1137 */
                            skl = ret.getVCoreSkillLevel(skid);
                            /*       */
                        }
                        /*  1139 */
                        ret.skills.put(Integer.valueOf(skid), new SkillEntry(skl, msl, rs.getLong("expiration"), teachId));
                        continue;
                        /*       */
                    }
                    /*  1141 */
                    if (skil == null &&
                            /*  1142 */             !JobConstants.is新手职业(skid / 10000) && !SkillConstants.isSpecialSkill(skid) && !SkillConstants.isAdminSkill(skid)) {
                        /*  1143 */
                        ret.remainingSp[JobConstants.getSkillBookBySkill(skid)] = ret.remainingSp[JobConstants.getSkillBookBySkill(skid)] + skl;
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*  1147 */
                rs.close();
                /*  1148 */
                ps.close();
                /*       */
                /*       */
                /*  1151 */
                ret.updateShinasBless();
                /*  1152 */
                if (client != null) {
                    /*  1153 */
                    ps = con.prepareStatement("SELECT id, level FROM characters WHERE accountid = ? AND world = ?");
                    /*  1154 */
                    ps.setInt(1, ret.accountid);
                    /*  1155 */
                    ps.setInt(2, ret.world);
                    /*  1156 */
                    rs = ps.executeQuery();
                    /*  1157 */
                    while (rs.next()) {
                        /*  1158 */
                        int id = rs.getInt("id");
                        /*  1159 */
                        int level = rs.getInt("level");
                        /*  1160 */
                        try (PreparedStatement psee = con.prepareStatement("SELECT skillid, masterlevel, expiration ,teachId FROM skills WHERE characterid = ?")) {
                            /*  1161 */
                            psee.setInt(1, id);
                            /*  1162 */
                            try (ResultSet rse = psee.executeQuery()) {
                                /*  1163 */
                                while (rse.next()) {
                                    /*  1164 */
                                    int m = SkillConstants.getLinkedSkillId(rse.getInt("skillid"));
                                    /*  1165 */
                                    Skill skill = SkillFactory.getSkill(rse.getInt("skillid"));
                                    /*  1166 */
                                    if (skill != null && skill.isTeachSkills() && level > 70) {
                                        /*  1167 */
                                        byte masterlevel = rse.getByte("masterlevel");
                                        /*  1168 */
                                        int teachId = rse.getInt("teachId");
                                        /*  1169 */
                                        int linkSkillslevel = SkillConstants.getLinkSkillslevel(skill.getMaxLevel(), skill, teachId, level);
                                        /*  1170 */
                                        ret.sonOfLinkedSkills.put(Integer.valueOf(m), new Pair(Integer.valueOf(id), new SkillEntry(linkSkillslevel, masterlevel, (rse.getLong("expiration") > 0L && System.currentTimeMillis() < rse.getLong("expiration") + 86400000L) ? rse.getLong("expiration") : -2L, (teachId > 0) ? teachId : id)));
                                        /*       */
                                    }
                                    /*       */
                                }
                                /*       */
                            }
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*  1177 */
                rs.close();
                /*  1178 */
                ps.close();
                /*       */
                /*  1180 */
                ret.mapleUnion = new MapleUnion();
                /*  1181 */
                ps = con.prepareStatement("SELECT `id`,`job`,`level`,`name` FROM characters WHERE accountid = ? ORDER BY level DESC");
                /*  1182 */
                ps.setInt(1, ret.accountid);
                /*  1183 */
                rs = ps.executeQuery();
                /*  1184 */
                while (rs.next()) {
                    /*  1185 */
                    int cid = rs.getInt("id");
                    /*  1186 */
                    int job = rs.getShort("job");
                    /*  1187 */
                    int level = rs.getShort("level");
                    /*  1188 */
                    String name = rs.getString("name");
                    /*  1189 */
                    if (level >= (JobConstants.is神之子(job) ? 130 : 60)) {
                        /*  1190 */
                        ret.mapleUnion.getAllCharacterMap().put(Integer.valueOf(cid), new MapleUnionData(cid, name, level, job));
                        /*       */
                    }
                    /*       */
                }
                /*  1193 */
                rs.close();
                /*  1194 */
                ps.close();
                /*       */
                /*  1196 */
                ps = con.prepareStatement("SELECT `characters_id`, `type`, `rotate`, `boardindex`, `local` FROM `mapleunion` WHERE `accounts_id` = ? AND `world` = ?");
                /*  1197 */
                ps.setInt(1, ret.accountid);
                /*  1198 */
                ps.setInt(2, ret.world);
                /*  1199 */
                rs = ps.executeQuery();
                /*  1200 */
                while (rs.next()) {
                    /*  1201 */
                    int cid = rs.getInt("characters_id");
                    /*  1202 */
                    MapleUnionData aj2 = ret.mapleUnion.getAllCharacterMap().get(Integer.valueOf(cid));
                    /*  1203 */
                    if (aj2 != null) {
                        /*  1204 */
                        int boardindex = rs.getInt("boardindex");
                        /*  1205 */
                        int rotate = rs.getInt("rotate");
                        /*  1206 */
                        int local = rs.getInt("local");
                        /*  1207 */
                        int type = rs.getInt("type");
                        /*  1208 */
                        if (boardindex > -1) {
                            /*  1209 */
                            MapleUnionData unionData = new MapleUnionData(cid, aj2.getName(), aj2.getLevel(), aj2.getJob());
                            /*  1210 */
                            unionData.setBoardindex(boardindex);
                            /*  1211 */
                            unionData.setRotate(rotate);
                            /*  1212 */
                            unionData.setLocal(local);
                            /*  1213 */
                            unionData.setType(type);
                            /*  1214 */
                            ret.mapleUnion.getCurrOnionMap().put(Integer.valueOf(cid), unionData);
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*  1218 */
                rs.close();
                /*  1219 */
                ps.close();
                /*       */
                /*       */
                /*  1222 */
                ps = con.prepareStatement("SELECT skillid, skilllevel, position, rank FROM innerskills WHERE characterid = ? LIMIT 3");
                /*  1223 */
                ps.setInt(1, charid);
                /*  1224 */
                rs = ps.executeQuery();
                /*  1225 */
                while (rs.next()) {
                    /*  1226 */
                    int skid = rs.getInt("skillid");
                    /*  1227 */
                    Skill skil = SkillFactory.getSkill(skid);
                    /*  1228 */
                    int skl = rs.getInt("skilllevel");
                    /*  1229 */
                    byte b1 = rs.getByte("position");
                    /*  1230 */
                    byte rank = rs.getByte("rank");
                    /*  1231 */
                    if (skil != null && skil.isInnerSkill() && b1 >= 1 && b1 <= 3) {
                        /*  1232 */
                        if (skl > skil.getMaxLevel()) {
                            /*  1233 */
                            skl = (byte) skil.getMaxLevel();
                            /*       */
                        }
                        /*  1235 */
                        InnerSkillEntry InnerSkill = new InnerSkillEntry(skid, skl, b1, rank);
                        /*  1236 */
                        ret.innerSkills[b1 - 1] = InnerSkill;
                        /*       */
                    }
                    /*       */
                }
                /*  1239 */
                rs.close();
                /*  1240 */
                ps.close();
                /*       */
                /*  1242 */
                ps = con.prepareStatement("SELECT * FROM characters WHERE accountid = ? ORDER BY level DESC");
                /*  1243 */
                ps.setInt(1, ret.accountid);
                /*  1244 */
                rs = ps.executeQuery();
                /*  1245 */
                int maxlevel_ = 0, maxlevel_2 = 0;
                /*  1246 */
                while (rs.next()) {
                    /*  1247 */
                    if (rs.getInt("id") != charid) {
                        /*  1248 */
                        if (JobConstants.is骑士团(rs.getShort("job"))) {
                            /*  1249 */
                            int m = rs.getShort("level") / 5;
                            /*  1250 */
                            if (m > 24) {
                                /*  1251 */
                                m = 24;
                                /*       */
                            }
                            /*  1253 */
                            if (m > maxlevel_2 || maxlevel_2 == 0) {
                                /*  1254 */
                                maxlevel_2 = m;
                                /*  1255 */
                                ret.BlessOfEmpress_Origin = rs.getString("name");
                                /*       */
                            }
                            /*       */
                        }
                        /*  1258 */
                        int maxlevel = rs.getShort("level") / 10;
                        /*  1259 */
                        if (maxlevel > 20) {
                            /*  1260 */
                            maxlevel = 20;
                            /*       */
                        }
                        /*  1262 */
                        if (maxlevel > maxlevel_ || maxlevel_ == 0) {
                            /*  1263 */
                            maxlevel_ = maxlevel;
                            /*  1264 */
                            ret.BlessOfFairy_Origin = rs.getString("name");
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*  1268 */
                if (ret.BlessOfFairy_Origin == null) {
                    /*  1269 */
                    ret.BlessOfFairy_Origin = ret.name;
                    /*       */
                }
                /*  1271 */
                int skillid = JobConstants.getBOF_ForJob(ret.job);
                /*  1272 */
                ret.skills.put(Integer.valueOf(skillid), new SkillEntry(maxlevel_, (byte) 0, -1L, 0));
                /*  1273 */
                if (SkillFactory.getSkill(JobConstants.getEmpress_ForJob(ret.job)) != null) {
                    /*  1274 */
                    if (ret.BlessOfEmpress_Origin == null) {
                        /*  1275 */
                        ret.BlessOfEmpress_Origin = ret.BlessOfFairy_Origin;
                        /*       */
                    }
                    /*  1277 */
                    ret.skills.put(Integer.valueOf(JobConstants.getEmpress_ForJob(ret.job)), new SkillEntry(maxlevel_2, (byte) 0, -1L, 0));
                    /*       */
                }
                /*  1279 */
                ps.close();
                /*  1280 */
                rs.close();
                /*       */
                /*       */
                /*  1283 */
                ps = con.prepareStatement("SELECT * FROM skillmacros WHERE characterid = ?");
                /*  1284 */
                ps.setInt(1, charid);
                /*  1285 */
                rs = ps.executeQuery();
                /*       */
                /*  1287 */
                while (rs.next()) {
                    /*  1288 */
                    int m = rs.getInt("position");
                    /*  1289 */
                    SkillMacro macro = new SkillMacro(rs.getInt("skill1"), rs.getInt("skill2"), rs.getInt("skill3"), rs.getString("name"), rs.getInt("shout"), m);
                    /*  1290 */
                    ret.skillMacros[m] = macro;
                    /*       */
                }
                /*  1292 */
                rs.close();
                /*  1293 */
                ps.close();
                /*       */
                /*  1295 */
                ps = con.prepareStatement("SELECT * FROM familiars WHERE characterid = ?");
                /*  1296 */
                ps.setInt(1, charid);
                /*  1297 */
                rs = ps.executeQuery();
                /*  1298 */
                while (rs.next()) {
                    /*  1299 */
                    int aiFamiliarID = ret.getAIFamiliarID();
                    /*  1300 */
                    MonsterFamiliar mf = new MonsterFamiliar(aiFamiliarID, charid, rs.getInt("familiar"), rs.getString("name"), rs.getByte("grade"), rs.getByte("level"), rs.getInt("exp"), rs.getShort("skillid"), rs.getInt("option1"), rs.getInt("option2"), rs.getInt("option3"), rs.getBoolean("summon"));
                    /*  1301 */
                    ret.familiars.put(Integer.valueOf(aiFamiliarID), mf);
                    /*  1302 */
                    if (mf.isSummon()) {
                        /*  1303 */
                        ret.spawnFamiliar(mf);
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*       */
                /*  1308 */
                ps = con.prepareStatement("SELECT * FROM pokemon WHERE characterid = ? OR (accountid = ? AND active = 0)");
                /*  1309 */
                ps.setInt(1, charid);
                /*  1310 */
                ps.setInt(2, ret.accountid);
                /*  1311 */
                rs = ps.executeQuery();
                /*  1312 */
                int position = 0;
                /*  1313 */
                while (rs.next()) {
                    /*  1314 */
                    Battler battler = new Battler(rs.getInt("level"), rs.getInt("exp"), charid, rs.getInt("monsterid"), rs.getString("name"), BattleConstants.PokemonNature.values()[rs.getInt("nature")], rs.getInt("itemid"), rs.getByte("gender"), rs.getByte("hpiv"), rs.getByte("atkiv"), rs.getByte("defiv"), rs.getByte("spatkiv"), rs.getByte("spdefiv"), rs.getByte("speediv"), rs.getByte("evaiv"), rs.getByte("acciv"), rs.getByte("ability"));
                    /*  1315 */
                    if (battler.getFamily() == null) {
                        /*       */
                        continue;
                        /*       */
                    }
                    /*  1318 */
                    if (rs.getInt("active") > 0 && position < 6 && rs.getInt("characterid") == charid) {
                        /*  1319 */
                        ret.battlers[position] = battler;
                        /*  1320 */
                        position++;
                        continue;
                        /*       */
                    }
                    /*  1322 */
                    ret.boxed.add(battler);
                    /*       */
                }
                /*       */
                /*  1325 */
                rs.close();
                /*  1326 */
                ps.close();
                /*       */
                /*  1328 */
                ps = con.prepareStatement("SELECT `key`,`type`,`action` FROM keymap WHERE characterid = ?");
                /*  1329 */
                ps.setInt(1, charid);
                /*  1330 */
                rs = ps.executeQuery();
                /*  1331 */
                Map<Integer, Pair<Byte, Integer>> keyb = ret.keylayout.Layout();
                /*  1332 */
                while (rs.next()) {
                    /*  1333 */
                    keyb.put(Integer.valueOf(rs.getInt("key")), new Pair(Byte.valueOf(rs.getByte("type")), Integer.valueOf(rs.getInt("action"))));
                    /*       */
                }
                /*  1335 */
                rs.close();
                /*  1336 */
                ps.close();
                /*  1337 */
                ret.keylayout.unchanged();
                /*       */
                /*  1339 */
                ps = con.prepareStatement("SELECT `index`, `key` FROM quickslot WHERE characterid = ?");
                /*  1340 */
                ps.setInt(1, charid);
                /*  1341 */
                rs = ps.executeQuery();
                /*  1342 */
                List<Pair<Integer, Integer>> quickslots = ret.quickslot.Layout();
                /*  1343 */
                while (rs.next()) {
                    /*  1344 */
                    quickslots.add(new Pair(Integer.valueOf(rs.getInt("index")), Integer.valueOf(rs.getInt("key"))));
                    /*       */
                }
                /*  1346 */
                rs.close();
                /*  1347 */
                ps.close();
                /*  1348 */
                ret.quickslot.unchanged();
                /*       */
                /*  1350 */
                ps = con.prepareStatement("SELECT `locationtype`,`map` FROM savedlocations WHERE characterid = ?");
                /*  1351 */
                ps.setInt(1, charid);
                /*  1352 */
                rs = ps.executeQuery();
                /*  1353 */
                while (rs.next()) {
                    /*  1354 */
                    ret.savedLocations[rs.getInt("locationtype")] = rs.getInt("map");
                    /*       */
                }
                /*  1356 */
                rs.close();
                /*  1357 */
                ps.close();
                /*       */
                /*  1359 */
                ps = con.prepareStatement("SELECT `characterid_to`,`when` FROM famelog WHERE characterid = ? AND DATEDIFF(NOW(),`when`) < 30");
                /*  1360 */
                ps.setInt(1, charid);
                /*  1361 */
                rs = ps.executeQuery();
                /*  1362 */
                ret.lastfametime = 0L;
                /*  1363 */
                ret.lastmonthfameids = new ArrayList<>(31);
                /*  1364 */
                while (rs.next()) {
                    /*  1365 */
                    ret.lastfametime = Math.max(ret.lastfametime, rs.getTimestamp("when").getTime());
                    /*  1366 */
                    ret.lastmonthfameids.add(Integer.valueOf(rs.getInt("characterid_to")));
                    /*       */
                }
                /*  1368 */
                rs.close();
                /*  1369 */
                ps.close();
                /*       */
                /*  1371 */
                ps = con.prepareStatement("SELECT `characterid_to`,`when` FROM lovelog WHERE characterid = ? AND DATEDIFF(NOW(),`when`) < 1");
                /*  1372 */
                ps.setInt(1, charid);
                /*  1373 */
                rs = ps.executeQuery();
                /*  1374 */
                ret.lastlovetime = 0L;
                /*  1375 */
                ret.lastdayloveids = new LinkedHashMap<>();
                /*  1376 */
                while (rs.next()) {
                    /*  1377 */
                    ret.lastlovetime = Math.max(ret.lastlovetime, rs.getTimestamp("when").getTime());
                    /*  1378 */
                    ret.lastdayloveids.put(Integer.valueOf(rs.getInt("characterid_to")), Long.valueOf(rs.getTimestamp("when").getTime()));
                    /*       */
                }
                /*  1380 */
                rs.close();
                /*  1381 */
                ps.close();
                /*       */
                /*  1383 */
                ps = con.prepareStatement("SELECT `accid_to`,`when` FROM battlelog WHERE accid = ? AND DATEDIFF(NOW(),`when`) < 30");
                /*  1384 */
                ps.setInt(1, ret.accountid);
                /*  1385 */
                rs = ps.executeQuery();
                /*  1386 */
                ret.lastmonthbattleids = new ArrayList<>();
                /*  1387 */
                while (rs.next()) {
                    /*  1388 */
                    ret.lastmonthbattleids.add(Integer.valueOf(rs.getInt("accid_to")));
                    /*       */
                }
                /*  1390 */
                rs.close();
                /*  1391 */
                ps.close();
                /*       */
                /*  1393 */
                ps = con.prepareStatement("SELECT `itemId` FROM extendedSlots WHERE characterid = ?");
                /*  1394 */
                ps.setInt(1, charid);
                /*  1395 */
                rs = ps.executeQuery();
                byte b;
                /*  1396 */
                for (b = 2; b <= 4; b = (byte) (b + 1)) {
                    /*  1397 */
                    ret.extendedSlots.put(Byte.valueOf(b), new ArrayList<>());
                    /*       */
                }
                /*  1399 */
                while (rs.next()) {
                    /*  1400 */
                    int itemid = rs.getInt("itemId");
                    /*  1401 */
                    ((List<Integer>) ret.extendedSlots.get(Byte.valueOf(ItemConstants.getInventoryType(itemid).getType()))).add(Integer.valueOf(itemid));
                    /*       */
                }
                /*  1403 */
                rs.close();
                /*  1404 */
                ps.close();
                /*       */
                /*  1406 */
                ret.buddylist.loadFromDb(charid);
                /*       */
                /*  1408 */
                ret.storage = MapleStorage.loadOrCreateFromDB(ret.accountid);
                /*       */
                /*  1410 */
                ret.cs = new CashShop(ret.accountid, charid, ret.getJob());
                /*       */
                /*  1412 */
                ps = con.prepareStatement("SELECT sn FROM wishlist WHERE characterid = ?");
                /*  1413 */
                ps.setInt(1, charid);
                /*  1414 */
                rs = ps.executeQuery();
                /*  1415 */
                int k = 0;
                /*  1416 */
                while (rs.next()) {
                    /*  1417 */
                    ret.wishlist[k] = rs.getInt("sn");
                    /*  1418 */
                    k++;
                    /*       */
                }
                /*  1420 */
                while (k < 12) {
                    /*  1421 */
                    ret.wishlist[k] = 0;
                    /*  1422 */
                    k++;
                    /*       */
                }
                /*  1424 */
                rs.close();
                /*  1425 */
                ps.close();
                /*       */
                /*  1427 */
                ps = con.prepareStatement("SELECT mapid,vip FROM trocklocations WHERE characterid = ? LIMIT 28");
                /*  1428 */
                ps.setInt(1, charid);
                /*  1429 */
                rs = ps.executeQuery();
                /*  1430 */
                int r = 0;
                /*  1431 */
                int reg = 0;
                /*  1432 */
                int hyper = 0;
                /*  1433 */
                while (rs.next()) {
                    /*  1434 */
                    if (rs.getInt("vip") == 0) {
                        /*  1435 */
                        ret.regrocks[reg] = rs.getInt("mapid");
                        /*  1436 */
                        reg++;
                        continue;
                        /*  1437 */
                    }
                    if (rs.getInt("vip") == 1) {
                        /*  1438 */
                        ret.rocks[r] = rs.getInt("mapid");
                        /*  1439 */
                        r++;
                        continue;
                        /*  1440 */
                    }
                    if (rs.getInt("vip") == 2) {
                        /*  1441 */
                        ret.hyperrocks[hyper] = rs.getInt("mapid");
                        /*  1442 */
                        hyper++;
                        /*       */
                    }
                    /*       */
                }
                /*  1445 */
                while (reg < 5) {
                    /*  1446 */
                    ret.regrocks[reg] = 999999999;
                    /*  1447 */
                    reg++;
                    /*       */
                }
                /*  1449 */
                while (r < 10) {
                    /*  1450 */
                    ret.rocks[r] = 999999999;
                    /*  1451 */
                    r++;
                    /*       */
                }
                /*  1453 */
                while (hyper < 13) {
                    /*  1454 */
                    ret.hyperrocks[hyper] = 999999999;
                    /*  1455 */
                    hyper++;
                    /*       */
                }
                /*  1457 */
                rs.close();
                /*  1458 */
                ps.close();
                /*       */
                /*  1460 */
                ps = con.prepareStatement("SELECT * FROM imps WHERE characterid = ?");
                /*  1461 */
                ps.setInt(1, charid);
                /*  1462 */
                rs = ps.executeQuery();
                /*  1463 */
                r = 0;
                /*  1464 */
                while (rs.next()) {
                    /*  1465 */
                    ret.imps[r] = new MapleImp(rs.getInt("itemid"));
                    /*  1466 */
                    ret.imps[r].setLevel(rs.getByte("level"));
                    /*  1467 */
                    ret.imps[r].setState(rs.getByte("state"));
                    /*  1468 */
                    ret.imps[r].setCloseness(rs.getShort("closeness"));
                    /*  1469 */
                    ret.imps[r].setFullness(rs.getShort("fullness"));
                    /*  1470 */
                    r++;
                    /*       */
                }
                /*  1472 */
                rs.close();
                /*  1473 */
                ps.close();
                /*       */
                /*  1475 */
                ps = con.prepareStatement("SELECT * FROM mountdata WHERE characterid = ?");
                /*  1476 */
                ps.setInt(1, charid);
                /*  1477 */
                rs = ps.executeQuery();
                /*  1478 */
                if (!rs.next()) {
                    /*  1479 */
                    throw new RuntimeException("在数据库中没有找到角色的坐骑信息...");
                    /*       */
                }
                /*  1481 */
                Item mount = ret.getInventory(MapleInventoryType.EQUIPPED).getItem((short) -18);
                /*  1482 */
                ret.mount = new MapleMount(ret, (mount != null) ? mount.getItemId() : 0, 80001000, rs.getByte("Fatigue"), rs.getByte("Level"), rs.getInt("Exp"));
                /*  1483 */
                ps.close();
                /*  1484 */
                rs.close();
                /*       */
                /*  1486 */
                ps = con.prepareStatement("SELECT * FROM character_potionpots WHERE characterid = ?");
                /*  1487 */
                ps.setInt(1, charid);
                /*  1488 */
                rs = ps.executeQuery();
                /*  1489 */
                if (rs.next()) {
                    /*  1490 */
                    ret.potionPot = new MaplePotionPot(charid, rs.getInt("itemId"), rs.getInt("hp"), rs.getInt("mp"), rs.getInt("maxValue"), rs.getLong("startDate"), rs.getLong("endDate"));
                    /*       */
                }
                /*  1492 */
                ps.close();
                /*  1493 */
                rs.close();
                /*       */
                /*  1495 */
                if (ret.getSkillLevel(1214) > 0 && JobConstants.is龙的传人(ret.job)) {
                    /*  1496 */
                    ret.coreAura = MapleCoreAura.loadFromDb(charid, ret.level);
                    /*  1497 */
                    if (ret.coreAura == null) {
                        /*  1498 */
                        ret.coreAura = MapleCoreAura.createCoreAura(charid, ret.level);
                        /*       */
                    }
                    /*  1500 */
                } else if (ret.getSkillTeachId(80001151) > 0) {
                    /*  1501 */
                    ret.coreAura = MapleCoreAura.loadFromDb(ret.getSkillTeachId(80001151));
                    /*       */
                }
                /*       */
                /*  1504 */
                ps = con.prepareStatement("SELECT * FROM character_credit WHERE characterid = ?");
                /*  1505 */
                ps.setInt(1, charid);
                /*  1506 */
                rs = ps.executeQuery();
                /*  1507 */
                while (rs.next()) {
                    /*  1508 */
                    ret.credit.put(rs.getString("name"), Integer.valueOf(rs.getInt("value")));
                    /*       */
                }
                /*  1510 */
                ps.close();
                /*  1511 */
                rs.close();
                /*       */
                /*       */
                /*       */
                /*  1515 */
                ps = con.prepareStatement("SELECT * FROM effectswitch WHERE `characterid` = ?");
                /*  1516 */
                ps.setInt(1, charid);
                /*  1517 */
                rs = ps.executeQuery();
                /*  1518 */
                while (rs.next()) {
                    /*  1519 */
                    ret.effectSwitch.add(Integer.valueOf(rs.getInt("pos")));
                    /*       */
                }
                /*  1521 */
                ps.close();
                /*  1522 */
                rs.close();
                /*       */
                /*  1524 */
                ret.stats.recalcLocalStats(true, ret);
                /*       */
            } else {
                /*  1526 */
                for (Pair<Item, MapleInventoryType> mit : (Iterable<Pair<Item, MapleInventoryType>>) ItemLoader.装备道具.loadItems(true, charid).values()) {
                    /*  1527 */
                    ret.getInventory((MapleInventoryType) mit.getRight()).addFromDB((Item) mit.getLeft());
                    /*       */
                }
                /*  1529 */
                ret.stats.recalcPVPRank(ret);
                /*       */
            }
            /*  1531 */
        } catch (SQLException ess) {
            /*  1532 */
            ret.getClient().getSession().close();
            /*  1533 */
            log.error("加载角色数据信息出错...", ess);
            /*       */
        } finally {
            /*       */
            try {
                /*  1536 */
                if (ps != null) {
                    /*  1537 */
                    ps.close();
                    /*       */
                }
                /*  1539 */
                if (rs != null) {
                    /*  1540 */
                    rs.close();
                    /*       */
                }
                /*  1542 */
            } catch (SQLException sQLException) {
            }
            /*       */
        }
        /*       */
        /*  1545 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public static void saveNewCharToDB(MapleCharacter chr, JobType type, short db, boolean oldkey) {
        /*  1552 */
        DruidPooledConnection con = null;
        /*       */
        /*  1554 */
        PreparedStatement ps = null;
        /*  1555 */
        PreparedStatement pse = null;
        /*  1556 */
        ResultSet rs = null;
        /*       */
        try {
            /*  1558 */
            con = DatabaseConnection.getInstance().getConnection();
            /*  1559 */
            con.setTransactionIsolation(1);
            /*  1560 */
            con.setAutoCommit(false);
            /*       */
            /*  1562 */
            ps = con.prepareStatement("INSERT INTO characters (level, str, dex, luk, `int`, hp, mp, maxhp, maxmp, sp, ap, skincolor, gender, job, hair, face, map, meso, party, buddyCapacity, pets, decorate, subcategory, friendshippoints, accountid, name, world, gm) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", 1);
            /*  1563 */
            int index = 0;
            /*  1564 */
            ps.setInt(++index, chr.level);
            /*  1565 */
            PlayerStats stat = chr.stats;
            /*  1566 */
            ps.setShort(++index, stat.getStr());
            /*  1567 */
            ps.setShort(++index, stat.getDex());
            /*  1568 */
            ps.setShort(++index, stat.getInt());
            /*  1569 */
            ps.setShort(++index, stat.getLuk());
            /*  1570 */
            ps.setInt(++index, stat.getHp());
            /*  1571 */
            ps.setInt(++index, stat.getMp());
            /*  1572 */
            ps.setInt(++index, stat.getMaxHp());
            /*  1573 */
            ps.setInt(++index, stat.getMaxMp());
            /*  1574 */
            StringBuilder sps = new StringBuilder();
            /*  1575 */
            for (int i = 0; i < chr.remainingSp.length; i++) {
                /*  1576 */
                sps.append(chr.remainingSp[i]);
                /*  1577 */
                sps.append(",");
                /*       */
            }
            /*  1579 */
            String sp = sps.toString();
            /*  1580 */
            ps.setString(++index, sp.substring(0, sp.length() - 1));
            /*  1581 */
            ps.setShort(++index, chr.remainingAp);
            /*       */
            /*  1583 */
            ps.setByte(++index, chr.skinColor);
            /*  1584 */
            ps.setByte(++index, chr.gender);
            /*  1585 */
            ps.setShort(++index, chr.job);
            /*  1586 */
            ps.setInt(++index, chr.hair);
            /*  1587 */
            ps.setInt(++index, chr.face);
            /*  1588 */
            if (db < 0 || db > 10) {
                /*  1589 */
                db = 0;
                /*       */
            }
            /*  1591 */
            ps.setInt(++index, ServerConfig.CHANNEL_PLAYER_BEGINNERMAP);
            /*  1592 */
            ps.setLong(++index, chr.meso.get());
            /*  1593 */
            ps.setInt(++index, -1);
            /*  1594 */
            ps.setByte(++index, chr.buddylist.getCapacity());
            /*  1595 */
            ps.setString(++index, "-1,-1,-1");
            /*  1596 */
            ps.setInt(++index, chr.decorate);
            /*  1597 */
            ps.setInt(++index, db);
            /*  1598 */
            ps.setString(++index, chr.friendshippoints[0] + "," + chr.friendshippoints[1] + "," + chr.friendshippoints[2] + "," + chr.friendshippoints[3] + "," + chr.friendshippoints[4]);
            /*  1599 */
            ps.setInt(++index, chr.getAccountID());
            /*  1600 */
            ps.setString(++index, chr.name);
            /*  1601 */
            ps.setByte(++index, chr.world);
            /*  1602 */
            ps.setInt(++index, chr.getGMLevel());
            /*  1603 */
            ps.executeUpdate();
            /*       */
            /*  1605 */
            rs = ps.getGeneratedKeys();
            /*  1606 */
            if (rs.next()) {
                /*  1607 */
                chr.id = rs.getInt(1);
                /*       */
            } else {
                /*  1609 */
                ps.close();
                /*  1610 */
                rs.close();
                /*  1611 */
                log.error("生成新角色到数据库出错...");
                /*       */
            }
            /*  1613 */
            ps.close();
            /*  1614 */
            rs.close();
            /*       */
            /*       */
            /*       */
            /*  1618 */
            ps = con.prepareStatement("INSERT INTO queststatus (`queststatusid`, `characterid`, `quest`, `status`, `time`, `forfeited`, `customData`) VALUES (DEFAULT, ?, ?, ?, ?, ?, ?)", 1);
            /*  1619 */
            pse = con.prepareStatement("INSERT INTO queststatusmobs VALUES (DEFAULT, ?, ?, ?)");
            /*  1620 */
            ps.setInt(1, chr.id);
            /*  1621 */
            for (MapleQuestStatus q : chr.quests.values()) {
                /*  1622 */
                ps.setInt(2, q.getQuest().getId());
                /*  1623 */
                ps.setInt(3, q.getStatus());
                /*  1624 */
                ps.setInt(4, (int) (q.getCompletionTime() / 1000L));
                /*  1625 */
                ps.setInt(5, q.getForfeited());
                /*  1626 */
                ps.setString(6, q.getCustomData());
                /*  1627 */
                ps.execute();
                /*  1628 */
                rs = ps.getGeneratedKeys();
                /*  1629 */
                if (q.hasMobKills()) {
                    /*  1630 */
                    rs.next();
                    /*  1631 */
                    for (Iterator<Integer> iterator = q.getMobKills().keySet().iterator(); iterator.hasNext(); ) {
                        int mob = ((Integer) iterator.next()).intValue();
                        /*  1632 */
                        pse.setInt(1, rs.getInt(1));
                        /*  1633 */
                        pse.setInt(2, mob);
                        /*  1634 */
                        pse.setInt(3, q.getMobKills(mob));
                        /*  1635 */
                        pse.execute();
                    }
                    /*       */
                    /*       */
                }
                /*  1638 */
                rs.close();
                /*       */
            }
            /*  1640 */
            ps.close();
            /*  1641 */
            pse.close();
            /*       */
            /*       */
            /*       */
            /*  1645 */
            ps = con.prepareStatement("INSERT INTO character_keyvalue (`characterid`, `key`, `value`) VALUES (?, ?, ?)");
            /*  1646 */
            ps.setInt(1, chr.id);
            /*  1647 */
            for (Map.Entry<String, String> key : chr.keyValue.entrySet()) {
                /*  1648 */
                ps.setString(2, key.getKey());
                /*  1649 */
                ps.setString(3, key.getValue());
                /*  1650 */
                ps.execute();
                /*       */
            }
            /*  1652 */
            ps.close();
            /*       */
            /*       */
            /*       */
            /*  1656 */
            ps = con.prepareStatement("INSERT INTO skills (characterid, skillid, skilllevel, masterlevel, expiration, teachId) VALUES (?, ?, ?, ?, ?, ?)");
            /*  1657 */
            ps.setInt(1, chr.id);
            /*  1658 */
            for (Map.Entry<Integer, SkillEntry> skill : chr.skills.entrySet()) {
                /*  1659 */
                if (SkillConstants.isApplicableSkill(((Integer) skill.getKey()).intValue())) {
                    /*  1660 */
                    ps.setInt(2, ((Integer) skill.getKey()).intValue());
                    /*  1661 */
                    ps.setInt(3, ((SkillEntry) skill.getValue()).skillevel);
                    /*  1662 */
                    ps.setByte(4, ((SkillEntry) skill.getValue()).masterlevel);
                    /*  1663 */
                    ps.setLong(5, ((SkillEntry) skill.getValue()).expiration);
                    /*  1664 */
                    ps.setInt(6, ((SkillEntry) skill.getValue()).teachId);
                    /*  1665 */
                    ps.execute();
                    /*       */
                }
                /*       */
            }
            /*  1668 */
            ps.close();
            /*       */
            /*       */
            /*       */
            /*  1672 */
            ps = con.prepareStatement("INSERT INTO inventoryslot (characterid, `equip`, `use`, `setup`, `etc`, `cash`) VALUES (?, ?, ?, ?, ?, ?)");
            /*  1673 */
            ps.setInt(1, chr.id);
            /*  1674 */
            ps.setShort(2, (short) 48);
            /*  1675 */
            ps.setShort(3, (short) 48);
            /*  1676 */
            ps.setShort(4, (short) 48);
            /*  1677 */
            ps.setShort(5, (short) 48);
            /*  1678 */
            ps.setShort(6, (short) 60);
            /*  1679 */
            ps.execute();
            /*  1680 */
            ps.close();
            /*       */
            /*       */
            /*       */
            /*  1684 */
            ps = con.prepareStatement("INSERT INTO mountdata (characterid, `Level`, `Exp`, `Fatigue`) VALUES (?, ?, ?, ?)");
            /*  1685 */
            ps.setInt(1, chr.id);
            /*  1686 */
            ps.setByte(2, (byte) 1);
            /*  1687 */
            ps.setInt(3, 0);
            /*  1688 */
            ps.setByte(4, (byte) 0);
            /*  1689 */
            ps.execute();
            /*  1690 */
            ps.close();
            /*       */
            /*       */
            /*       */
            /*       */
            /*  1695 */
            int[] array1 = {1, 2, 3, 4, 5, 6, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31, 34, 35, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 50, 56, 57, 59, 60, 61, 63, 64, 65, 66, 70};
            /*  1696 */
            int[] array2 = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 4};
            /*  1697 */
            int[] array3 = {46, 10, 12, 13, 18, 23, 8, 5, 0, 4, 27, 30, 39, 1, 41, 19, 14, 15, 52, 2, 17, 11, 3, 20, 26, 16, 22, 9, 50, 51, 6, 31, 29, 7, 53, 54, 100, 101, 102, 103, 104, 105, 106, 47};
            /*       */
            /*  1699 */
            int[] new_array1 = {1, 20, 21, 22, 23, 25, 26, 27, 29, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 52, 56, 57, 59, 60, 61, 63, 64, 65, 66, 70, 71, 73, 79, 82, 83};
            /*  1700 */
            int[] new_array2 = {4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4};
            /*  1701 */
            int[] new_array3 = {46, 27, 30, 0, 1, 19, 14, 15, 52, 17, 11, 8, 3, 20, 26, 16, 22, 9, 50, 51, 2, 31, 29, 5, 7, 4, 53, 54, 100, 101, 102, 103, 104, 105, 106, 47, 12, 13, 23, 10, 18};
            /*       */
            /*  1703 */
            ps = con.prepareStatement("INSERT INTO keymap (characterid, `key`, `type`, `action`) VALUES (?, ?, ?, ?)");
            /*  1704 */
            ps.setInt(1, chr.id);
            /*  1705 */
            int keylength = oldkey ? array1.length : new_array1.length;
            /*  1706 */
            for (int j = 0; j < keylength; j++) {
                /*  1707 */
                ps.setInt(2, oldkey ? array1[j] : new_array1[j]);
                /*  1708 */
                ps.setInt(3, oldkey ? array2[j] : new_array2[j]);
                /*  1709 */
                ps.setInt(4, oldkey ? array3[j] : new_array3[j]);
                /*  1710 */
                ps.execute();
                /*       */
            }
            /*  1712 */
            ps.close();
            /*       */
            /*  1714 */
            List<Pair<Item, MapleInventoryType>> itemsWithType = new ArrayList<>();
            /*  1715 */
            for (MapleInventory iv : chr.inventory) {
                /*  1716 */
                for (Item item : iv.list()) {
                    /*  1717 */
                    itemsWithType.add(new Pair(item, iv.getType()));
                    /*       */
                }
                /*       */
            }
            /*  1720 */
            ItemLoader.装备道具.saveItems(con, itemsWithType, chr.id);
            /*  1721 */
            con.commit();
            /*  1722 */
        } catch (Exception e) {
            /*  1723 */
            log.error("[charsave] Error saving character data", e);
            /*       */
            try {
                /*  1725 */
                con.rollback();
                /*  1726 */
            } catch (SQLException ex) {
                /*  1727 */
                log.error("[charsave] Error Rolling Back", ex);
                /*       */
            }
            /*       */
        } finally {
            /*       */
            try {
                /*  1731 */
                if (pse != null) {
                    /*  1732 */
                    pse.close();
                    /*       */
                }
                /*  1734 */
                if (ps != null) {
                    /*  1735 */
                    ps.close();
                    /*       */
                }
                /*  1737 */
                if (rs != null) {
                    /*  1738 */
                    rs.close();
                    /*       */
                }
                /*  1740 */
                con.setAutoCommit(true);
                /*  1741 */
                con.setTransactionIsolation(4);
                /*  1742 */
            } catch (SQLException e) {
                /*  1743 */
                log.error("[charsave] Error going back to autocommit mode", e);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public static void deleteWhereCharacterId(Connection con, String sql, int id) throws SQLException {
        /*  1749 */
        PreparedStatement ps = con.prepareStatement(sql);
        /*  1750 */
        ps.setInt(1, id);
        /*  1751 */
        ps.executeUpdate();
        /*  1752 */
        ps.close();
        /*       */
    }

    /*       */
    /*       */
    public static void deleteWhereCharacterId_NoLock(Connection con, String sql, int id) throws SQLException {
        /*  1756 */
        PreparedStatement ps = con.prepareStatement(sql);
        /*  1757 */
        ps.setInt(1, id);
        /*  1758 */
        ps.execute();
        /*  1759 */
        ps.close();
        /*       */
    }

    /*       */
    /*       */
    public static boolean ban(String id, String reason, boolean accountId, int gmlevel, boolean hellban) {
        /*  1763 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*       */
            PreparedStatement ps;
            /*  1765 */
            if (id.matches("/[0-9]{1,3}\\..*")) {
                /*  1766 */
                ps = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?)");
                /*  1767 */
                ps.setString(1, id);
                /*  1768 */
                ps.execute();
                /*  1769 */
                ps.close();
                /*  1770 */
                return true;
                /*       */
            }
            /*  1772 */
            if (accountId) {
                /*  1773 */
                ps = con.prepareStatement("SELECT id FROM accounts WHERE name = ?");
                /*       */
            } else {
                /*  1775 */
                ps = con.prepareStatement("SELECT accountid FROM characters WHERE name = ?");
                /*       */
            }
            /*  1777 */
            boolean ret = false;
            /*  1778 */
            ps.setString(1, id);
            /*  1779 */
            ResultSet rs = ps.executeQuery();
            /*  1780 */
            if (rs.next()) {
                /*  1781 */
                int z = rs.getInt(1);
                /*  1782 */
                PreparedStatement psb = con.prepareStatement("UPDATE accounts SET banned = 1, banreason = ? WHERE id = ? AND gm < ?");
                /*  1783 */
                psb.setString(1, reason);
                /*  1784 */
                psb.setInt(2, z);
                /*  1785 */
                psb.setInt(3, gmlevel);
                /*  1786 */
                psb.execute();
                /*  1787 */
                psb.close();
                /*  1788 */
                if (gmlevel > 100) {
                    /*  1789 */
                    PreparedStatement psa = con.prepareStatement("SELECT * FROM accounts WHERE id = ?");
                    /*  1790 */
                    psa.setInt(1, z);
                    /*  1791 */
                    ResultSet rsa = psa.executeQuery();
                    /*  1792 */
                    if (rsa.next()) {
                        /*  1793 */
                        String sessionIP = rsa.getString("sessionIP");
                        /*  1794 */
                        if (sessionIP != null && sessionIP.matches("/[0-9]{1,3}\\..*")) {
                            /*  1795 */
                            PreparedStatement psz = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?)");
                            /*  1796 */
                            psz.setString(1, sessionIP);
                            /*  1797 */
                            psz.execute();
                            /*  1798 */
                            psz.close();
                            /*       */
                        }
                        /*  1800 */
                        String macData = rsa.getString("macs");
                        /*  1801 */
                        if (macData != null && !macData.equalsIgnoreCase("00-00-00-00-00-00") && macData.length() >= 17) {
                            /*  1802 */
                            PreparedStatement psm = con.prepareStatement("INSERT INTO macbans VALUES (DEFAULT, ?)");
                            /*  1803 */
                            psm.setString(1, macData);
                            /*  1804 */
                            psm.execute();
                            /*  1805 */
                            psm.close();
                            /*       */
                        }
                        /*  1807 */
                        if (hellban) {
                            /*  1808 */
                            PreparedStatement pss = con.prepareStatement("UPDATE accounts SET banned = 1, banreason = ? WHERE email = ?" + ((sessionIP == null) ? "" : " OR SessionIP = ?"));
                            /*  1809 */
                            pss.setString(1, reason);
                            /*  1810 */
                            pss.setString(2, rsa.getString("email"));
                            /*  1811 */
                            if (sessionIP != null) {
                                /*  1812 */
                                pss.setString(3, sessionIP);
                                /*       */
                            }
                            /*  1814 */
                            pss.execute();
                            /*  1815 */
                            pss.close();
                            /*       */
                        }
                        /*       */
                    }
                    /*  1818 */
                    rsa.close();
                    /*  1819 */
                    psa.close();
                    /*       */
                }
                /*  1821 */
                ret = true;
                /*       */
            }
            /*  1823 */
            rs.close();
            /*  1824 */
            ps.close();
            /*  1825 */
            return ret;
            /*  1826 */
        } catch (SQLException ex) {
            /*  1827 */
            System.err.println("Error while banning" + ex);
            /*       */
            /*  1829 */
            return false;
            /*       */
        }
        /*       */
    }

    /*       */
    public static byte checkExistance(int accid, int cid) {
        /*  1833 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  1834 */
            try (PreparedStatement ps = con.prepareStatement("SELECT * FROM hiredmerch WHERE accountid = ? AND characterid = ?")) {
                /*  1835 */
                ps.setInt(1, accid);
                /*  1836 */
                ps.setInt(2, cid);
                /*  1837 */
                try (ResultSet rs = ps.executeQuery()) {
                    /*  1838 */
                    if (rs.next()) {
                        /*  1839 */
                        ps.close();
                        /*  1840 */
                        rs.close();
                        /*  1841 */
                        return 1;
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*  1845 */
            return 0;
            /*  1846 */
        } catch (SQLException se) {
            /*  1847 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public static void removePartTime(int cid) {
        /*  1852 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /*  1853 */         PreparedStatement ps = con.prepareStatement("DELETE FROM parttime WHERE cid = ?")) {
            /*  1854 */
            ps.setInt(1, cid);
            /*  1855 */
            ps.executeUpdate();
            /*       */
        }
        /*  1857 */ catch (SQLException ex) {
            /*  1858 */
            System.out.println("无法删除打工信息: " + ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public static void addPartTime(MaplePartTimeJob partTime) {
        /*  1863 */
        if (partTime.getCharacterId() < 1) {
            /*       */
            return;
            /*       */
        }
        /*  1866 */
        addPartTime(partTime.getCharacterId(), partTime.getJob(), partTime.getTime(), partTime.getReward());
        /*       */
    }

    /*       */
    /*       */
    public static void addPartTime(int cid, byte job, long time, int reward) {
        /*  1870 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /*  1871 */         PreparedStatement ps = con.prepareStatement("INSERT INTO parttime (cid, job, time, reward) VALUES (?, ?, ?, ?)")) {
            /*  1872 */
            ps.setInt(1, cid);
            /*  1873 */
            ps.setByte(2, job);
            /*  1874 */
            ps.setLong(3, time);
            /*  1875 */
            ps.setInt(4, reward);
            /*  1876 */
            ps.execute();
            /*       */
        }
        /*  1878 */ catch (SQLException ex) {
            /*  1879 */
            System.out.println("无法添加打工信息: " + ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public static MaplePartTimeJob getPartTime(int cid) {
        /*  1884 */
        MaplePartTimeJob partTime = new MaplePartTimeJob(cid);
        /*  1885 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /*  1886 */         PreparedStatement ps = con.prepareStatement("SELECT * FROM parttime WHERE cid = ?")) {
            /*  1887 */
            ps.setInt(1, cid);
            /*  1888 */
            try (ResultSet rs = ps.executeQuery()) {
                /*  1889 */
                if (rs.next()) {
                    /*  1890 */
                    partTime.setJob(rs.getByte("job"));
                    /*  1891 */
                    partTime.setTime(rs.getLong("time"));
                    /*  1892 */
                    partTime.setReward(rs.getInt("reward"));
                    /*       */
                }
                /*       */
                /*       */
            }
            /*  1896 */
        } catch (Exception ex) {
            /*  1897 */
            System.out.println("无法查询打工信息: " + ex);
            /*       */
        }
        /*  1899 */
        return partTime;
        /*       */
    }

    /*       */
    /*       */
    public static boolean hasSkill(Map<Integer, SkillEntry> cskills, int skillid, int level) {
        /*  1903 */
        if (cskills.get(Integer.valueOf(skillid)) != null) {
            /*  1904 */
            return (((SkillEntry) cskills.get(Integer.valueOf(skillid))).skillevel == level && cskills.containsKey(Integer.valueOf(skillid)));
            /*       */
        }
        /*  1906 */
        return cskills.containsKey(Integer.valueOf(skillid));
        /*       */
    }

    /*       */
    /*       */
    public static MapleCharacter getOnlineCharacterById(int cid) {
        /*  1910 */
        return WorldFindService.getInstance().findCharacterById(cid);
        /*       */
    }

    /*       */
    /*       */
    public static MapleCharacter getCharacterById(int n2) {
        /*  1914 */
        MapleCharacter player = getOnlineCharacterById(n2);
        /*  1915 */
        return (player == null) ? loadCharFromDB(n2, new MapleClient(null, null, null), true) : player;
        /*       */
    }

    /*       */
    /*       */
    public static int getLevelbyid(int cid) {
        /*  1919 */
        int level = -1;
        /*  1920 */
        try (DruidPooledConnection conn = DatabaseConnection.getInstance().getConnection();
                /*  1921 */         PreparedStatement ps = conn.prepareStatement("SELECT `level` FROM characters WHERE id = ?")) {
            /*  1922 */
            ps.setInt(1, cid);
            /*  1923 */
            try (ResultSet rs = ps.executeQuery()) {
                /*  1924 */
                if (rs.next()) {
                    /*  1925 */
                    level = rs.getInt("level");
                    /*       */
                }
                /*       */
            }
            /*       */
            /*  1929 */
        } catch (SQLException e) {
            /*  1930 */
            log.error("读取角色等级失败", e);
            /*       */
        }
        /*  1932 */
        return level;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void saveToDB(boolean dc, boolean fromcs) {
        /*  1955 */
        if (this.isSaveing) {
            /*  1956 */
            log.info(MapleClient.getLogMessage(getClient(), "正在保存数据，本次操作返回."));
            /*       */
            return;
            /*       */
        }
        /*  1959 */
        DruidPooledConnection con = null;
        /*  1960 */
        PreparedStatement ps = null;
        /*  1961 */
        PreparedStatement pse = null;
        /*  1962 */
        ResultSet rs = null;
        /*       */
        /*       */
        try {
            /*  1965 */
            con = DatabaseConnection.getInstance().getConnection();
            /*  1966 */
            this.isSaveing = true;
            /*  1967 */
            con.setTransactionIsolation(1);
            /*  1968 */
            con.setAutoCommit(false);
            /*       */
            /*  1970 */
            ps = con.prepareStatement("SELECT * FROM characters WHERE id = ?");
            /*  1971 */
            ps.setInt(1, this.id);
            /*  1972 */
            rs = ps.executeQuery();
            /*  1973 */
            if (rs.next()) {
                /*  1974 */
                ps.close();
                /*  1975 */
                rs.close();
                /*       */
                /*  1977 */
                ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, basecolor = ?, mixedcolor = ?, probcolor = ?, face = ?, map = ?, meso = ?, hpApUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, pets = ?, subcategory = ?, marriageId = ?, currentrep = ?, totalrep = ?, gachexp = ?, fatigue = ?, charm = ?, charisma = ?, craft = ?, insight = ?, sense = ?, will = ?, totalwins = ?, totallosses = ?, pvpExp = ?, pvpPoints = ?, decorate = ?, beans = ?, warning = ?, reborns = ?, reborns1 = ?, reborns2 = ?, reborns3 = ?, apstorage = ?, honor = ?, love = ?, playerPoints = ?, playerEnergy = ?, pvpDeaths = ?, pvpKills = ?, pvpVictory = ?, vip = ?, viptime = ?, todayonlinetime = ?, totalonlinetime = ?, friendshiptoadd = ?, friendshippoints = ?, name = ?, wp = ? WHERE id = ?", 1);
                /*  1978 */
                int index = 0;
                /*  1979 */
                ps.setInt(++index, this.level);
                /*  1980 */
                ps.setInt(++index, this.fame);
                /*  1981 */
                ps.setShort(++index, this.stats.getStr());
                /*  1982 */
                ps.setShort(++index, this.stats.getDex());
                /*  1983 */
                ps.setShort(++index, this.stats.getLuk());
                /*  1984 */
                ps.setShort(++index, this.stats.getInt());
                /*  1985 */
                ps.setLong(++index, (this.level >= getMaxLevelForSever()) ? 0L : Math.abs(this.exp.get()));
                /*  1986 */
                ps.setInt(++index, (this.stats.getHp() < 1) ? 50 : this.stats.getHp());
                /*  1987 */
                ps.setInt(++index, this.stats.getMp());
                /*  1988 */
                ps.setInt(++index, this.stats.getMaxHp());
                /*  1989 */
                ps.setInt(++index, this.stats.getMaxMp());
                /*  1990 */
                StringBuilder sps = new StringBuilder();
                /*  1991 */
                for (int aRemainingSp : this.remainingSp) {
                    /*  1992 */
                    sps.append(aRemainingSp);
                    /*  1993 */
                    sps.append(",");
                    /*       */
                }
                /*  1995 */
                String sp = sps.toString();
                /*  1996 */
                ps.setString(++index, sp.substring(0, sp.length() - 1));
                /*  1997 */
                ps.setShort(++index, this.remainingAp);
                /*  1998 */
                ps.setByte(++index, this.gmLevel);
                /*  1999 */
                ps.setByte(++index, this.skinColor);
                /*  2000 */
                ps.setByte(++index, this.gender);
                /*  2001 */
                ps.setShort(++index, this.job);
                /*  2002 */
                ps.setInt(++index, this.hair);
                /*  2003 */
                ps.setByte(++index, this.hairBaseColor);
                /*  2004 */
                ps.setByte(++index, this.hairMixedColor);
                /*  2005 */
                ps.setByte(++index, this.hairProbColor);
                /*  2006 */
                ps.setInt(++index, this.face);
                /*  2007 */
                if (!fromcs && this.map != null) {
                    /*  2008 */
                    if (this.map.getForcedReturnId() != 999999999 && this.map.getForcedReturnMap() != null) {
                        /*  2009 */
                        this.mapid = this.map.getForcedReturnId();
                        /*       */
                    } else {
                        /*  2011 */
                        this.mapid = (this.stats.getHp() < 1) ? this.map.getReturnMapId() : this.map.getId();
                        /*       */
                    }
                    /*       */
                }
                /*  2014 */
                ps.setInt(++index, GameConstants.getOverrideReturnMap(this.mapid));
                /*  2015 */
                ps.setLong(++index, this.meso.get());
                /*  2016 */
                ps.setShort(++index, this.hpApUsed);
                /*  2017 */
                if (this.map == null) {
                    /*  2018 */
                    ps.setByte(++index, (byte) 0);
                    /*       */
                } else {
                    /*  2020 */
                    MaplePortal closest = this.map.findClosestSpawnpoint(getTruePosition());
                    /*  2021 */
                    ps.setByte(++index, (byte) ((closest != null) ? closest.getId() : 0));
                    /*       */
                }
                /*  2023 */
                ps.setInt(++index, (this.party == null) ? -1 : this.party.getPartyId());
                /*  2024 */
                ps.setShort(++index, (short) this.buddylist.getCapacity());
                /*  2025 */
                StringBuilder petz = new StringBuilder();
                /*  2026 */
                for (int i = 0; i < 3; i++) {
                    /*  2027 */
                    if (this.spawnPets[i] != null && this.spawnPets[i].getSummoned()) {
                        /*  2028 */
                        this.spawnPets[i].saveToDb();
                        /*  2029 */
                        petz.append(this.spawnPets[i].getInventoryPosition());
                        /*  2030 */
                        petz.append(",");
                        /*       */
                    } else {
                        /*  2032 */
                        petz.append("-1,");
                        /*       */
                    }
                    /*       */
                }
                /*  2035 */
                String petstring = petz.toString();
                /*  2036 */
                ps.setString(++index, petstring.substring(0, petstring.length() - 1));
                /*  2037 */
                ps.setByte(++index, this.subcategory);
                /*  2038 */
                ps.setInt(++index, this.marriageId);
                /*  2039 */
                ps.setInt(++index, this.currentrep);
                /*  2040 */
                ps.setInt(++index, this.totalrep);
                /*  2041 */
                ps.setInt(++index, this.gachexp);
                /*  2042 */
                ps.setShort(++index, this.fatigue);
                /*  2043 */
                ps.setInt(++index, ((MapleTrait) this.traits.get(MapleTraitType.charm)).getTotalExp());
                /*  2044 */
                ps.setInt(++index, ((MapleTrait) this.traits.get(MapleTraitType.charisma)).getTotalExp());
                /*  2045 */
                ps.setInt(++index, ((MapleTrait) this.traits.get(MapleTraitType.craft)).getTotalExp());
                /*  2046 */
                ps.setInt(++index, ((MapleTrait) this.traits.get(MapleTraitType.insight)).getTotalExp());
                /*  2047 */
                ps.setInt(++index, ((MapleTrait) this.traits.get(MapleTraitType.sense)).getTotalExp());
                /*  2048 */
                ps.setInt(++index, ((MapleTrait) this.traits.get(MapleTraitType.will)).getTotalExp());
                /*  2049 */
                ps.setInt(++index, this.totalWins);
                /*  2050 */
                ps.setInt(++index, this.totalLosses);
                /*  2051 */
                ps.setInt(++index, this.pvpExp);
                /*  2052 */
                ps.setInt(++index, this.pvpPoints);
                /*       */
                /*  2054 */
                ps.setInt(++index, this.decorate);
                /*       */
                /*  2056 */
                ps.setInt(++index, this.beans);
                /*       */
                /*  2058 */
                ps.setInt(++index, this.warning);
                /*       */
                /*  2060 */
                ps.setInt(++index, this.reborns);
                /*  2061 */
                ps.setInt(++index, this.reborns1);
                /*  2062 */
                ps.setInt(++index, this.reborns2);
                /*  2063 */
                ps.setInt(++index, this.reborns3);
                /*  2064 */
                ps.setInt(++index, this.apstorage);
                /*       */
                /*  2066 */
                ps.setInt(++index, this.honor);
                /*       */
                /*  2068 */
                ps.setInt(++index, this.love);
                /*       */
                /*  2070 */
                ps.setInt(++index, this.playerPoints);
                /*  2071 */
                ps.setInt(++index, this.playerEnergy);
                /*       */
                /*  2073 */
                ps.setInt(++index, this.pvpDeaths);
                /*  2074 */
                ps.setInt(++index, this.pvpKills);
                /*  2075 */
                ps.setInt(++index, this.pvpVictory);
                /*       */
                /*  2077 */
                ps.setInt(++index, this.vip);
                /*  2078 */
                ps.setTimestamp(++index, getViptime());
                /*  2079 */
                ps.setInt(++index, this.todayonlinetime + (int) ((System.currentTimeMillis() - this.todayonlinetimestamp.getTime()) / 60000L));
                /*  2080 */
                ps.setInt(++index, this.totalonlinetime + (int) ((System.currentTimeMillis() - this.todayonlinetimestamp.getTime()) / 60000L));
                /*  2081 */
                ps.setInt(++index, this.friendshiptoadd);
                /*  2082 */
                ps.setString(++index, this.friendshippoints[0] + "," + this.friendshippoints[1] + "," + this.friendshippoints[2] + "," + this.friendshippoints[3] + "," + this.friendshippoints[4]);
                /*       */
                /*  2084 */
                ps.setString(++index, this.name);
                /*  2085 */
                ps.setInt(++index, this.weaponPoint);
                /*  2086 */
                ps.setInt(++index, this.id);
                /*  2087 */
                if (ps.executeUpdate() < 1) {
                    /*  2088 */
                    ps.close();
                    /*  2089 */
                    log.error("Character not in database (" + this.id + ")");
                    /*       */
                }
                /*  2091 */
                ps.close();
                /*       */
                /*       */
                /*       */
                /*  2095 */
                if (this.changed_skillmacros) {
                    /*  2096 */
                    this.changed_skillmacros = false;
                    /*  2097 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM skillmacros WHERE characterid = ?");
                    /*  2098 */
                    for (int j = 0; j < 5; j++) {
                        /*  2099 */
                        SkillMacro macro = this.skillMacros[j];
                        /*  2100 */
                        if (macro != null) {
                            /*  2101 */
                            ps = con.prepareStatement("INSERT INTO skillmacros (characterid, skill1, skill2, skill3, name, shout, position) VALUES (?, ?, ?, ?, ?, ?, ?)");
                            /*  2102 */
                            ps.setInt(1, this.id);
                            /*  2103 */
                            ps.setInt(2, macro.getSkill1());
                            /*  2104 */
                            ps.setInt(3, macro.getSkill2());
                            /*  2105 */
                            ps.setInt(4, macro.getSkill3());
                            /*  2106 */
                            ps.setString(5, macro.getName());
                            /*  2107 */
                            ps.setInt(6, macro.getShout());
                            /*  2108 */
                            ps.setInt(7, j);
                            /*  2109 */
                            ps.execute();
                            /*  2110 */
                            ps.close();
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*  2114 */
                if (this.changed_pokemon) {
                    /*  2115 */
                    this.changed_pokemon = false;
                    /*  2116 */
                    ps = con.prepareStatement("DELETE FROM pokemon WHERE characterid = ? OR (accountid = ? AND active = 0)");
                    /*  2117 */
                    ps.setInt(1, this.id);
                    /*  2118 */
                    ps.setInt(2, this.accountid);
                    /*  2119 */
                    ps.execute();
                    /*  2120 */
                    ps.close();
                    /*  2121 */
                    ps = con.prepareStatement("INSERT INTO pokemon (characterid, level, exp, monsterid, name, nature, active, accountid, itemid, gender, hpiv, atkiv, defiv, spatkiv, spdefiv, speediv, evaiv, acciv, ability) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
                    /*  2122 */
                    for (Battler macro : this.battlers) {
                        /*  2123 */
                        if (macro != null) {
                            /*  2124 */
                            ps.setInt(1, this.id);
                            /*  2125 */
                            ps.setInt(2, macro.getLevel());
                            /*  2126 */
                            ps.setInt(3, macro.getExp());
                            /*  2127 */
                            ps.setInt(4, macro.getMonsterId());
                            /*  2128 */
                            ps.setString(5, macro.getName());
                            /*  2129 */
                            ps.setInt(6, macro.getNature().ordinal());
                            /*  2130 */
                            ps.setInt(7, 1);
                            /*  2131 */
                            ps.setInt(8, this.accountid);
                            /*  2132 */
                            ps.setInt(9, (macro.getItem() == null) ? 0 : (macro.getItem()).id);
                            /*  2133 */
                            ps.setByte(10, macro.getGender());
                            /*  2134 */
                            ps.setByte(11, macro.getIV(BattleConstants.PokemonStat.HP));
                            /*  2135 */
                            ps.setByte(12, macro.getIV(BattleConstants.PokemonStat.ATK));
                            /*  2136 */
                            ps.setByte(13, macro.getIV(BattleConstants.PokemonStat.DEF));
                            /*  2137 */
                            ps.setByte(14, macro.getIV(BattleConstants.PokemonStat.SPATK));
                            /*  2138 */
                            ps.setByte(15, macro.getIV(BattleConstants.PokemonStat.SPDEF));
                            /*  2139 */
                            ps.setByte(16, macro.getIV(BattleConstants.PokemonStat.SPEED));
                            /*  2140 */
                            ps.setByte(17, macro.getIV(BattleConstants.PokemonStat.EVA));
                            /*  2141 */
                            ps.setByte(18, macro.getIV(BattleConstants.PokemonStat.ACC));
                            /*  2142 */
                            ps.setByte(19, macro.getAbilityIndex());
                            /*  2143 */
                            ps.execute();
                            /*       */
                        }
                        /*       */
                    }
                    /*  2146 */
                    for (Battler macro : this.boxed) {
                        /*  2147 */
                        ps.setInt(1, this.id);
                        /*  2148 */
                        ps.setInt(2, macro.getLevel());
                        /*  2149 */
                        ps.setInt(3, macro.getExp());
                        /*  2150 */
                        ps.setInt(4, macro.getMonsterId());
                        /*  2151 */
                        ps.setString(5, macro.getName());
                        /*  2152 */
                        ps.setInt(6, macro.getNature().ordinal());
                        /*  2153 */
                        ps.setInt(7, 0);
                        /*  2154 */
                        ps.setInt(8, this.accountid);
                        /*  2155 */
                        ps.setInt(9, (macro.getItem() == null) ? 0 : (macro.getItem()).id);
                        /*  2156 */
                        ps.setByte(10, macro.getGender());
                        /*  2157 */
                        ps.setByte(11, macro.getIV(BattleConstants.PokemonStat.HP));
                        /*  2158 */
                        ps.setByte(12, macro.getIV(BattleConstants.PokemonStat.ATK));
                        /*  2159 */
                        ps.setByte(13, macro.getIV(BattleConstants.PokemonStat.DEF));
                        /*  2160 */
                        ps.setByte(14, macro.getIV(BattleConstants.PokemonStat.SPATK));
                        /*  2161 */
                        ps.setByte(15, macro.getIV(BattleConstants.PokemonStat.SPDEF));
                        /*  2162 */
                        ps.setByte(16, macro.getIV(BattleConstants.PokemonStat.SPEED));
                        /*  2163 */
                        ps.setByte(17, macro.getIV(BattleConstants.PokemonStat.EVA));
                        /*  2164 */
                        ps.setByte(18, macro.getIV(BattleConstants.PokemonStat.ACC));
                        /*  2165 */
                        ps.setByte(19, macro.getAbilityIndex());
                        /*  2166 */
                        ps.execute();
                        /*       */
                    }
                    /*  2168 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2173 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM inventoryslot WHERE characterid = ?");
                /*  2174 */
                ps = con.prepareStatement("INSERT INTO inventoryslot (characterid, `equip`, `use`, `setup`, `etc`, `cash`) VALUES (?, ?, ?, ?, ?, ?)");
                /*  2175 */
                ps.setInt(1, this.id);
                /*  2176 */
                ps.setShort(2, getInventory(MapleInventoryType.EQUIP).getSlotLimit());
                /*  2177 */
                ps.setShort(3, getInventory(MapleInventoryType.USE).getSlotLimit());
                /*  2178 */
                ps.setShort(4, getInventory(MapleInventoryType.SETUP).getSlotLimit());
                /*  2179 */
                ps.setShort(5, getInventory(MapleInventoryType.ETC).getSlotLimit());
                /*  2180 */
                ps.setShort(6, getInventory(MapleInventoryType.CASH).getSlotLimit());
                /*  2181 */
                ps.execute();
                /*  2182 */
                ps.close();
                /*       */
                /*       */
                /*       */
                /*  2186 */
                List<Pair<Item, MapleInventoryType>> itemsWithType = new ArrayList<>();
                /*  2187 */
                for (MapleInventory iv : this.inventory) {
                    /*  2188 */
                    for (Item item : iv.list()) {
                        /*  2189 */
                        itemsWithType.add(new Pair(item, iv.getType()));
                        /*       */
                    }
                    /*       */
                }
                /*  2192 */
                ItemLoader.装备道具.saveItems(con, itemsWithType, this.id);
                /*       */
                /*       */
                /*       */
                /*  2196 */
                if (this.changed_keyValue) {
                    /*  2197 */
                    this.changed_keyValue = false;
                    /*  2198 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM character_keyvalue WHERE characterid = ?");
                    /*  2199 */
                    ps = con.prepareStatement("INSERT INTO character_keyvalue (`characterid`, `key`, `value`) VALUES (?, ?, ?)");
                    /*  2200 */
                    ps.setInt(1, this.id);
                    /*  2201 */
                    for (Map.Entry<String, String> key : this.keyValue.entrySet()) {
                        /*  2202 */
                        ps.setString(2, key.getKey());
                        /*  2203 */
                        ps.setString(3, key.getValue());
                        /*  2204 */
                        ps.execute();
                        /*       */
                    }
                    /*  2206 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2211 */
                if (this.changed_questinfo) {
                    /*  2212 */
                    this.changed_questinfo = false;
                    /*  2213 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM questinfo WHERE characterid = ?");
                    /*  2214 */
                    ps = con.prepareStatement("INSERT INTO questinfo (`accountid`, `characterid`, `quest`, `customData`) VALUES (?, ?, ?, ?)");
                    /*  2215 */
                    ps.setInt(1, this.accountid);
                    /*  2216 */
                    ps.setInt(2, this.id);
                    /*  2217 */
                    for (Map.Entry<Integer, String> q : this.questinfo.entrySet()) {
                        /*  2218 */
                        ps.setInt(3, ((Integer) q.getKey()).intValue());
                        /*  2219 */
                        ps.setString(4, q.getValue());
                        /*  2220 */
                        ps.execute();
                        /*       */
                    }
                    /*  2222 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2227 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM queststatus WHERE characterid = ?");
                /*  2228 */
                ps = con.prepareStatement("INSERT INTO queststatus (`queststatusid`, `characterid`, `quest`, `status`, `time`, `forfeited`, `customData`) VALUES (DEFAULT, ?, ?, ?, ?, ?, ?)", 1);
                /*  2229 */
                pse = con.prepareStatement("INSERT INTO queststatusmobs VALUES (DEFAULT, ?, ?, ?)");
                /*  2230 */
                ps.setInt(1, this.id);
                /*  2231 */
                for (MapleQuestStatus q : this.quests.values()) {
                    /*  2232 */
                    ps.setInt(2, q.getQuest().getId());
                    /*  2233 */
                    ps.setInt(3, q.getStatus());
                    /*  2234 */
                    ps.setInt(4, (int) (q.getCompletionTime() / 1000L));
                    /*  2235 */
                    ps.setInt(5, q.getForfeited());
                    /*  2236 */
                    ps.setString(6, q.getCustomData());
                    /*  2237 */
                    ps.execute();
                    /*  2238 */
                    rs = ps.getGeneratedKeys();
                    /*  2239 */
                    if (q.hasMobKills()) {
                        /*  2240 */
                        rs.next();
                        /*  2241 */
                        for (Iterator<Integer> iterator = q.getMobKills().keySet().iterator(); iterator.hasNext(); ) {
                            int mob = ((Integer) iterator.next()).intValue();
                            /*  2242 */
                            pse.setInt(1, rs.getInt(1));
                            /*  2243 */
                            pse.setInt(2, mob);
                            /*  2244 */
                            pse.setInt(3, q.getMobKills(mob));
                            /*  2245 */
                            pse.execute();
                        }
                        /*       */
                        /*       */
                    }
                    /*  2248 */
                    rs.close();
                    /*       */
                }
                /*  2250 */
                ps.close();
                /*  2251 */
                pse.close();
                /*       */
                /*       */
                /*       */
                /*  2255 */
                if (this.changed_skills) {
                    /*  2256 */
                    this.changed_skills = false;
                    /*  2257 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM skills WHERE characterid = ?");
                    /*  2258 */
                    ps = con.prepareStatement("INSERT INTO skills (characterid, skillid, skilllevel, masterlevel, expiration, teachId, position) VALUES (?, ?, ?, ?, ?, ?, ?)");
                    /*  2259 */
                    ps.setInt(1, this.id);
                    /*  2260 */
                    for (Map.Entry<Integer, SkillEntry> skill : this.skills.entrySet()) {
                        /*  2261 */
                        if (SkillConstants.isApplicableSkill(((Integer) skill.getKey()).intValue())) {
                            /*  2262 */
                            ps.setInt(2, ((Integer) skill.getKey()).intValue());
                            /*  2263 */
                            ps.setInt(3, ((SkillEntry) skill.getValue()).skillevel);
                            /*  2264 */
                            ps.setByte(4, ((SkillEntry) skill.getValue()).masterlevel);
                            /*  2265 */
                            ps.setLong(5, ((SkillEntry) skill.getValue()).expiration);
                            /*  2266 */
                            ps.setInt(6, ((SkillEntry) skill.getValue()).teachId);
                            /*  2267 */
                            ps.setByte(7, ((SkillEntry) skill.getValue()).position);
                            /*  2268 */
                            ps.execute();
                            /*       */
                        }
                        /*       */
                    }
                    /*  2271 */
                    ps.close();
                    /*       */
                } else {
                    /*  2273 */
                    System.out.println("玩家好像正在保存技能数据信息被跳过：" + getName());
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2278 */
                if (this.changed_innerSkills) {
                    /*  2279 */
                    this.changed_innerSkills = false;
                    /*  2280 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM innerskills WHERE characterid = ?");
                    /*  2281 */
                    for (int j = 0; j < 3; j++) {
                        /*  2282 */
                        InnerSkillEntry InnerSkill = this.innerSkills[j];
                        /*  2283 */
                        if (InnerSkill != null) {
                            /*  2284 */
                            ps = con.prepareStatement("INSERT INTO innerskills (characterid, skillid, skilllevel, position, rank) VALUES (?, ?, ?, ?, ?)");
                            /*  2285 */
                            ps.setInt(1, this.id);
                            /*  2286 */
                            ps.setInt(2, InnerSkill.getSkillId());
                            /*  2287 */
                            ps.setInt(3, InnerSkill.getSkillLevel());
                            /*  2288 */
                            ps.setByte(4, InnerSkill.getPosition());
                            /*  2289 */
                            ps.setByte(5, InnerSkill.getRank());
                            /*  2290 */
                            ps.execute();
                            /*  2291 */
                            ps.close();
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*  2296 */
                if (this.changed_union) {
                    /*  2297 */
                    this.changed_union = false;
                    /*  2298 */
                    ps = con.prepareStatement("DELETE FROM `mapleunion` WHERE `accounts_id` = ? AND `world` = ?");
                    /*  2299 */
                    ps.setInt(1, this.accountid);
                    /*  2300 */
                    ps.setInt(2, this.world);
                    /*  2301 */
                    ps.executeUpdate();
                    /*  2302 */
                    ps.close();
                    /*  2303 */
                    ps = con.prepareStatement("INSERT INTO mapleunion (`accounts_id`, `world`, `characters_id`, `type`, `rotate`, `boardindex`, `local`) VALUES (?, ?, ?, ?, ?, ?, ?)");
                    /*  2304 */
                    ps.setInt(1, this.accountid);
                    /*  2305 */
                    ps.setInt(2, this.world);
                    /*  2306 */
                    for (Map.Entry<Integer, MapleUnionData> entry : this.mapleUnion.getCurrOnionMap().entrySet()) {
                        /*  2307 */
                        MapleUnionData value = entry.getValue();
                        /*  2308 */
                        ps.setInt(3, value.getCid());
                        /*  2309 */
                        ps.setInt(4, value.getType());
                        /*  2310 */
                        ps.setInt(5, value.getRotate());
                        /*  2311 */
                        ps.setInt(6, value.getBoardindex());
                        /*  2312 */
                        ps.setInt(7, value.getLocal());
                        /*  2313 */
                        ps.execute();
                        /*       */
                    }
                    /*  2315 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2320 */
                List<MapleCoolDownValueHolder> coolDownInfo = getCooldowns();
                /*  2321 */
                if (dc && coolDownInfo.size() > 0) {
                    /*  2322 */
                    ps = con.prepareStatement("INSERT INTO skills_cooldowns (charid, SkillID, StartTime, length) VALUES (?, ?, ?, ?)");
                    /*  2323 */
                    ps.setInt(1, getId());
                    /*  2324 */
                    for (MapleCoolDownValueHolder cooling : coolDownInfo) {
                        /*  2325 */
                        ps.setInt(2, cooling.skillId);
                        /*  2326 */
                        ps.setLong(3, cooling.startTime);
                        /*  2327 */
                        ps.setLong(4, cooling.length);
                        /*  2328 */
                        ps.execute();
                        /*       */
                    }
                    /*  2330 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2335 */
                if (this.changed_savedlocations) {
                    /*  2336 */
                    this.changed_savedlocations = false;
                    /*  2337 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM savedlocations WHERE characterid = ?");
                    /*  2338 */
                    ps = con.prepareStatement("INSERT INTO savedlocations (characterid, `locationtype`, `map`) VALUES (?, ?, ?)");
                    /*  2339 */
                    ps.setInt(1, this.id);
                    /*  2340 */
                    for (SavedLocationType savedLocationType : SavedLocationType.values()) {
                        /*  2341 */
                        if (this.savedLocations[savedLocationType.getValue()] != -1) {
                            /*  2342 */
                            ps.setInt(2, savedLocationType.getValue());
                            /*  2343 */
                            ps.setInt(3, this.savedLocations[savedLocationType.getValue()]);
                            /*  2344 */
                            ps.execute();
                            /*       */
                        }
                        /*       */
                    }
                    /*  2347 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2352 */
                if (this.changed_achievements) {
                    /*  2353 */
                    this.changed_achievements = false;
                    /*  2354 */
                    ps = con.prepareStatement("DELETE FROM achievements WHERE accountid = ?");
                    /*  2355 */
                    ps.setInt(1, this.accountid);
                    /*  2356 */
                    ps.executeUpdate();
                    /*  2357 */
                    ps.close();
                    /*  2358 */
                    ps = con.prepareStatement("INSERT INTO achievements(charid, achievementid, accountid) VALUES(?, ?, ?)");
                    /*  2359 */
                    for (Integer achid : this.finishedAchievements) {
                        /*  2360 */
                        ps.setInt(1, this.id);
                        /*  2361 */
                        ps.setInt(2, achid.intValue());
                        /*  2362 */
                        ps.setInt(3, this.accountid);
                        /*  2363 */
                        ps.execute();
                        /*       */
                    }
                    /*  2365 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2370 */
                if (this.changed_reports) {
                    /*  2371 */
                    this.changed_reports = false;
                    /*  2372 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM reports WHERE characterid = ?");
                    /*  2373 */
                    ps = con.prepareStatement("INSERT INTO reports VALUES(DEFAULT, ?, ?, ?)");
                    /*  2374 */
                    for (Map.Entry<ReportType, Integer> achid : this.reports.entrySet()) {
                        /*  2375 */
                        ps.setInt(1, this.id);
                        /*  2376 */
                        ps.setByte(2, ((ReportType) achid.getKey()).i);
                        /*  2377 */
                        ps.setInt(3, ((Integer) achid.getValue()).intValue());
                        /*  2378 */
                        ps.execute();
                        /*       */
                    }
                    /*  2380 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2385 */
                if (this.buddylist.changed()) {
                    /*  2386 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM buddies WHERE characterid = ?");
                    /*  2387 */
                    ps = con.prepareStatement("INSERT INTO buddies (characterid, `buddyid`, `pending`) VALUES (?, ?, ?)");
                    /*  2388 */
                    ps.setInt(1, this.id);
                    /*  2389 */
                    for (BuddylistEntry entry : this.buddylist.getBuddies()) {
                        /*  2390 */
                        ps.setInt(2, entry.getCharacterId());
                        /*  2391 */
                        ps.setInt(3, entry.isVisible() ? 5 : 7);
                        /*  2392 */
                        ps.execute();
                        /*       */
                    }
                    /*  2394 */
                    ps.close();
                    /*  2395 */
                    this.buddylist.setChanged(false);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2400 */
                ps = con.prepareStatement("UPDATE accounts SET `points` = ?, `vpoints` = ? WHERE id = ?");
                /*  2401 */
                ps.setInt(1, this.points);
                /*  2402 */
                ps.setInt(2, this.vpoints);
                /*  2403 */
                ps.setInt(3, this.accountid);
                /*  2404 */
                ps.executeUpdate();
                /*  2405 */
                ps.close();
                /*       */
                /*       */
                /*       */
                /*  2409 */
                if (this.storage != null) {
                    /*  2410 */
                    this.storage.saveToDB(con);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2415 */
                if (this.cs != null) {
                    /*  2416 */
                    this.cs.save(con);
                    /*       */
                }
                /*  2418 */
                PlayerNPC.updateByCharId(con, this);
                /*       */
                /*       */
                /*       */
                /*  2422 */
                this.keylayout.saveKeys(con, this.id);
                /*       */
                /*       */
                /*       */
                /*  2426 */
                this.quickslot.saveQuickSlots(con, this.id);
                /*       */
                /*       */
                /*       */
                /*  2430 */
                if (this.mount != null) {
                    /*  2431 */
                    this.mount.saveMount(con, this.id);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2436 */
                if (this.android != null) {
                    /*  2437 */
                    this.android.saveToDb(con);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2442 */
                if (this.monsterbook != null) {
                    /*  2443 */
                    this.monsterbook.saveCards(con, this.accountid);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2448 */
                if (this.pvpStats != null) {
                    /*  2449 */
                    this.pvpStats.saveToDb(con, this.accountid);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2454 */
                if (this.potionPot != null) {
                    /*  2455 */
                    this.potionPot.saveToDb(con);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2460 */
                if (this.coreAura != null && this.coreAura.getId() == this.id) {
                    /*  2461 */
                    this.coreAura.saveToDb(con);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2466 */
                if (this.changed_familiars) {
                    /*  2467 */
                    this.changed_familiars = false;
                    /*  2468 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM familiars WHERE characterid = ?");
                    /*  2469 */
                    ps = con.prepareStatement("INSERT INTO familiars (characterid, familiar, name, level, exp, grade, skillid, option1, option2, option3, summon) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
                    /*  2470 */
                    ps.setInt(1, this.id);
                    /*  2471 */
                    for (MonsterFamiliar familiar : this.familiars.values()) {
                        /*  2472 */
                        ps.setInt(2, familiar.getFamiliar());
                        /*  2473 */
                        ps.setString(3, familiar.getName());
                        /*  2474 */
                        ps.setInt(4, familiar.getLevel());
                        /*  2475 */
                        ps.setInt(5, familiar.getExp());
                        /*  2476 */
                        ps.setInt(6, familiar.getGrade());
                        /*  2477 */
                        ps.setInt(7, familiar.getSkill());
                        /*  2478 */
                        ps.setInt(8, familiar.getOption1());
                        /*  2479 */
                        ps.setInt(9, familiar.getOption2());
                        /*  2480 */
                        ps.setInt(10, familiar.getOption3());
                        /*  2481 */
                        ps.setBoolean(11, familiar.isSummon());
                        /*  2482 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*  2484 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*       */
                /*  2490 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM imps WHERE characterid = ?");
                /*  2491 */
                ps = con.prepareStatement("INSERT INTO imps (characterid, itemid, closeness, fullness, state, level) VALUES (?, ?, ?, ?, ?, ?)");
                /*  2492 */
                ps.setInt(1, this.id);
                /*  2493 */
                for (MapleImp imp : this.imps) {
                    /*  2494 */
                    if (imp != null) {
                        /*  2495 */
                        ps.setInt(2, imp.getItemId());
                        /*  2496 */
                        ps.setShort(3, imp.getCloseness());
                        /*  2497 */
                        ps.setShort(4, imp.getFullness());
                        /*  2498 */
                        ps.setByte(5, imp.getState());
                        /*  2499 */
                        ps.setByte(6, imp.getLevel());
                        /*  2500 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*       */
                }
                /*  2503 */
                ps.close();
                /*       */
                /*       */
                /*       */
                /*  2507 */
                if (this.changed_wishlist) {
                    /*  2508 */
                    this.changed_wishlist = false;
                    /*  2509 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM wishlist WHERE characterid = ?");
                    /*  2510 */
                    for (int j = 0; j < getWishlistSize(); j++) {
                        /*  2511 */
                        ps = con.prepareStatement("INSERT INTO wishlist(characterid, sn) VALUES(?, ?) ");
                        /*  2512 */
                        ps.setInt(1, getId());
                        /*  2513 */
                        ps.setInt(2, this.wishlist[j]);
                        /*  2514 */
                        ps.executeUpdate();
                        /*  2515 */
                        ps.close();
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2521 */
                if (this.changed_trocklocations) {
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*  2527 */
                    this.changed_trocklocations = false;
                    /*  2528 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM trocklocations WHERE characterid = ?");
                    /*  2529 */
                    for (int regrock : this.regrocks) {
                        /*  2530 */
                        if (regrock != 999999999) {
                            /*  2531 */
                            ps = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 0)");
                            /*  2532 */
                            ps.setInt(1, getId());
                            /*  2533 */
                            ps.setInt(2, regrock);
                            /*  2534 */
                            ps.executeUpdate();
                            /*  2535 */
                            ps.close();
                            /*       */
                        }
                        /*       */
                    }
                    /*  2538 */
                    for (int rock : this.rocks) {
                        /*  2539 */
                        if (rock != 999999999) {
                            /*  2540 */
                            ps = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 1)");
                            /*  2541 */
                            ps.setInt(1, getId());
                            /*  2542 */
                            ps.setInt(2, rock);
                            /*  2543 */
                            ps.executeUpdate();
                            /*  2544 */
                            ps.close();
                            /*       */
                        }
                        /*       */
                    }
                    /*  2547 */
                    for (int hyperrock : this.hyperrocks) {
                        /*  2548 */
                        if (hyperrock != 999999999) {
                            /*  2549 */
                            ps = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 2)");
                            /*  2550 */
                            ps.setInt(1, getId());
                            /*  2551 */
                            ps.setInt(2, hyperrock);
                            /*  2552 */
                            ps.executeUpdate();
                            /*  2553 */
                            ps.close();
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2560 */
                if (this.changed_extendedSlots) {
                    /*  2561 */
                    this.changed_extendedSlots = false;
                    /*  2562 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM extendedSlots WHERE characterid = ?");
                    /*  2563 */
                    for (Map.Entry<Byte, List<Integer>> entry : this.extendedSlots.entrySet()) {
                        /*  2564 */
                        for (Integer integer : entry.getValue()) {
                            /*  2565 */
                            if (getInventory(MapleInventoryType.USE).findById(integer.intValue()) != null ||
                                    /*  2566 */                 getInventory(MapleInventoryType.SETUP).findById(integer.intValue()) != null ||
                                    /*  2567 */                 getInventory(MapleInventoryType.ETC).findById(integer.intValue()) != null) {
                                /*       */
                                /*  2569 */
                                ps = con.prepareStatement("INSERT INTO extendedSlots(characterid, itemId) VALUES(?, ?) ");
                                /*  2570 */
                                ps.setInt(1, getId());
                                /*  2571 */
                                ps.setInt(2, integer.intValue());
                                /*  2572 */
                                ps.executeUpdate();
                                /*  2573 */
                                ps.close();
                                /*       */
                            }
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  2581 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM character_credit WHERE characterid = ?");
                /*  2582 */
                ps = con.prepareStatement("INSERT INTO character_credit(characterid, name, value) VALUES(?, ?, ?)");
                /*  2583 */
                for (Map.Entry<String, Integer> entry : this.credit.entrySet()) {
                    /*  2584 */
                    ps.setInt(1, getId());
                    /*  2585 */
                    ps.setString(2, entry.getKey());
                    /*  2586 */
                    ps.setInt(3, ((Integer) entry.getValue()).intValue());
                    /*  2587 */
                    ps.executeUpdate();
                    /*       */
                }
                /*  2589 */
                ps.close();
                /*       */
                /*       */
                /*       */
                /*  2593 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM effectswitch WHERE `characterid` = ?");
                /*  2594 */
                ps = con.prepareStatement("INSERT INTO effectswitch (characterid, pos) VALUES (?, ?)");
                /*  2595 */
                for (Integer effect : this.effectSwitch) {
                    /*  2596 */
                    ps.setInt(1, getId());
                    /*  2597 */
                    ps.setInt(2, effect.intValue());
                    /*  2598 */
                    ps.executeUpdate();
                    /*       */
                }
                /*  2600 */
                ps.close();
                /*       */
                /*  2602 */
                if (this.changed_vcores) {
                    /*  2603 */
                    this.changed_vcores = false;
                    /*  2604 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM vcoreskill WHERE characterid = ?");
                    /*  2605 */
                    ps = con.prepareStatement("INSERT INTO vcoreskill (characterid, vcoreid, level, exp, skill1, skill2, skill3, dateexpire, slot, `index`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
                    /*  2606 */
                    ps.setInt(1, getId());
                    /*  2607 */
                    for (VCoreSkillEntry vCoreSkillEntry : this.vCoreSkills.values()) {
                        /*  2608 */
                        if (vCoreSkillEntry.getSlot() > 0) {
                            /*  2609 */
                            ps.setInt(2, vCoreSkillEntry.getVcoreid());
                            /*  2610 */
                            ps.setInt(3, vCoreSkillEntry.getLevel());
                            /*  2611 */
                            ps.setInt(4, vCoreSkillEntry.getExp());
                            /*  2612 */
                            ps.setInt(5, vCoreSkillEntry.getSkill1());
                            /*  2613 */
                            ps.setInt(6, vCoreSkillEntry.getSkill2());
                            /*  2614 */
                            ps.setInt(7, vCoreSkillEntry.getSkill3());
                            /*  2615 */
                            ps.setLong(8, vCoreSkillEntry.getDateExpire());
                            /*  2616 */
                            ps.setInt(9, vCoreSkillEntry.getSlot());
                            /*  2617 */
                            ps.setInt(10, vCoreSkillEntry.getIndex());
                            /*  2618 */
                            ps.executeUpdate();
                            /*       */
                        }
                        /*       */
                    }
                    /*  2621 */
                    ps.close();
                    /*       */
                    /*  2623 */
                    deleteWhereCharacterId((Connection) con, "DELETE FROM `vmatrixslot` WHERE `characters_id` = ?");
                    /*  2624 */
                    ps = con.prepareStatement("INSERT INTO `vmatrixslot` (`characters_id`, `slot`, `extend`, `unlock`) VALUES (?, ?, ?, ?)");
                    /*  2625 */
                    ps.setInt(1, getId());
                    /*  2626 */
                    for (VMatrixSlotEntry vmse : this.vMatrixSlots.values()) {
                        /*  2627 */
                        ps.setInt(2, vmse.getSlot());
                        /*  2628 */
                        ps.setInt(3, vmse.getExtend());
                        /*  2629 */
                        ps.setInt(4, vmse.getUnlock());
                        /*  2630 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*  2632 */
                    ps.close();
                    /*       */
                }
                /*       */
                /*  2635 */
                con.commit();
                /*       */
            }
            /*  2637 */
        } catch (SQLException e) {
            /*  2638 */
            log.error("[charsave] 保存角色数据出现错误 .", e);
            /*       */
            try {
                /*  2640 */
                con.rollback();
                /*  2641 */
            } catch (SQLException ex) {
                /*  2642 */
                log.error("[charsave] Error Rolling Back", e);
                /*       */
            }
            /*       */
        } finally {
            /*  2645 */
            this.isSaveing = false;
            /*       */
            try {
                /*  2647 */
                if (ps != null) {
                    /*  2648 */
                    ps.close();
                    /*       */
                }
                /*  2650 */
                if (pse != null) {
                    /*  2651 */
                    pse.close();
                    /*       */
                }
                /*  2653 */
                if (rs != null) {
                    /*  2654 */
                    rs.close();
                    /*       */
                }
                /*  2656 */
                con.setAutoCommit(true);
                /*  2657 */
                con.setTransactionIsolation(4);
                /*  2658 */
                if (con != null) {
                    /*  2659 */
                    con.close();
                    /*       */
                }
                /*  2661 */
            } catch (SQLException e) {
                /*  2662 */
                log.error("[charsave] Error going back to autocommit mode", e);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    private void deleteWhereCharacterId(Connection con, String sql) throws SQLException {
        /*  2668 */
        deleteWhereCharacterId(con, sql, this.id);
        /*       */
    }

    /*       */
    /*       */
    public final int[] getFriendShipPoints() {
        /*  2672 */
        return this.friendshippoints;
        /*       */
    }

    /*       */
    /*       */
    public final void setFriendShipPoints(int joejoe, int hermoninny, int littledragon, int ika, int Wooden) {
        /*  2676 */
        this.friendshippoints[0] = joejoe;
        /*  2677 */
        this.friendshippoints[1] = hermoninny;
        /*  2678 */
        this.friendshippoints[2] = littledragon;
        /*  2679 */
        this.friendshippoints[3] = ika;
        /*  2680 */
        this.friendshippoints[4] = Wooden;
        /*       */
    }

    /*       */
    /*       */
    public final int getFriendShipToAdd() {
        /*  2684 */
        return this.friendshiptoadd;
        /*       */
    }

    /*       */
    /*       */
    public final void setFriendShipToAdd(int points) {
        /*  2688 */
        this.friendshiptoadd = points;
        /*       */
    }

    /*       */
    /*       */
    public final void addFriendShipToAdd(int points) {
        /*  2692 */
        this.friendshiptoadd += points;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public PlayerStats getStat() {
        /*  2701 */
        return this.stats;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public PlayerSpecialStats getSpecialStat() {
        /*  2708 */
        return this.specialStats;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelMapTimeLimitTask() {
        /*  2715 */
        if (this.mapTimeLimitTask != null) {
            /*  2716 */
            this.mapTimeLimitTask.cancel(false);
            /*  2717 */
            this.mapTimeLimitTask = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void startQuestTimeLimitTask(int quest, int time) {
        /*  2722 */
        send(MaplePacketCreator.startQuestTimeLimit(quest, time));
        /*  2723 */
        this.questTimeLimitTask = Timer.MapTimer.getInstance().register(() -> send(MaplePacketCreator.stopQuestTimeLimit(quest)), time);
        /*       */
    }

    /*       */
    /*       */
    public void startMapTimeLimitTask(int time, MapleMap to) {
        if (time <= 0) {
            time = 1;
        }

        this.cancelMapTimeLimitTask();
        this.client.announce(MaplePacketCreator.getClock(time));
        MapleMap ourMap = this.getMap();
        time *= 1000;
        this.mapTimeLimitTask = Timer.MapTimer.getInstance().register(() -> {
            if (ourMap.getId() == 180000001) {
                this.getQuestNAdd(MapleQuest.getInstance(123455)).setCustomData(String.valueOf(System.currentTimeMillis()));
                this.getQuestNAdd(MapleQuest.getInstance(123456)).setCustomData("0");
            }

            this.changeMap(to, to.getPortal(0));
        }, (long) time, (long) time);
    }


    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getTouchedRune() {
        /*  2744 */
        return this.touchedrune;
        /*       */
    }

    /*       */
    /*       */
    public void setTouchedRune(int type) {
        /*  2748 */
        this.touchedrune = type;
        /*       */
    }

    /*       */
    /*       */
    public long getRuneTimeStamp() {
        /*  2752 */
        return Long.parseLong(getKeyValue("LastTouchedRune"));
        /*       */
    }

    /*       */
    /*       */
    public void setRuneTimeStamp(long time) {
        /*  2756 */
        setKeyValue("LastTouchedRune", String.valueOf(time));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<String, String> getKeyValue_Map() {
        /*  2763 */
        return this.keyValue;
        /*       */
    }

    /*       */
    /*       */
    public String getKeyValue(String key) {
        /*  2767 */
        if (this.keyValue.containsKey(key)) {
            /*  2768 */
            return this.keyValue.get(key);
            /*       */
        }
        /*  2770 */
        return null;
        /*       */
    }

    /*       */
    /*       */
    public void setKeyValue(String key, String values) {
        /*  2774 */
        this.keyValue.put(key, values);
        /*  2775 */
        this.changed_keyValue = true;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateInfoQuest(int questid, String data) {
        /*  2782 */
        updateInfoQuest(questid, data, true);
        /*       */
    }

    /*       */
    /*       */
    public void updateQuestInfo(int questid, String data, boolean show) {
        /*  2786 */
        updateInfoQuest(questid, data, show);
        /*       */
    }

    /*       */
    /*       */
    public void updateInfoQuest(int questid, String data, boolean show) {
        /*  2790 */
        this.questinfo.put(Integer.valueOf(questid), data);
        /*  2791 */
        this.changed_questinfo = true;
        /*  2792 */
        if (show) {
            /*  2793 */
            this.client.announce(MaplePacketCreator.updateInfoQuest(questid, data));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void removeInfoQuest(int questid) {
        /*  2798 */
        if (this.questinfo.containsKey(Integer.valueOf(questid))) {
            /*  2799 */
            updateInfoQuest(questid, "");
            /*  2800 */
            this.questinfo.remove(Integer.valueOf(questid));
            /*  2801 */
            this.changed_questinfo = true;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public String getInfoQuest(int questid) {
        /*  2806 */
        if (this.questinfo.containsKey(Integer.valueOf(questid))) {
            /*  2807 */
            return this.questinfo.get(Integer.valueOf(questid));
            /*       */
        }
        /*  2809 */
        return "";
        /*       */
    }

    /*       */
    /*       */
    public String getQuestInfo(int questid) {
        /*  2813 */
        return getInfoQuest(questid);
        /*       */
    }

    /*       */
    /*       */
    public String getQuestInfo(int questid, String stat) {
        /*  2817 */
        return getInfoQuestStatS(questid, stat);
        /*       */
    }

    /*       */
    /*       */
    public String getInfoQuestStatS(int id, String stat) {
        /*  2821 */
        String info = getInfoQuest(id);
        /*  2822 */
        if (info != null && info.length() > 0 && info.contains(stat)) {
            /*  2823 */
            int startIndex = info.indexOf(stat) + stat.length() + 1;
            /*  2824 */
            int until = info.indexOf(";", startIndex);
            /*  2825 */
            return info.substring(startIndex, (until != -1) ? until : info.length());
            /*       */
        }
        /*  2827 */
        return "";
        /*       */
    }

    /*       */
    /*       */
    public int getInfoQuestStat(int id, String stat) {
        /*  2831 */
        String statz = getInfoQuestStatS(id, stat);
        /*  2832 */
        return (statz == null || "".equals(statz)) ? 0 : Integer.parseInt(statz);
        /*       */
    }

    /*       */
    /*       */
    public PlayerObservable getPlayerObservable() {
        /*  2836 */
        return this.playerObservable;
        /*       */
    }

    /*       */
    /*       */
    public void setInfoQuestStat(int id, String stat, int statData) {
        /*  2840 */
        setInfoQuestStat(id, stat, statData);
        /*       */
    }

    /*       */
    /*       */
    public void setInfoQuestStat(int id, String stat, String statData) {
        /*  2844 */
        String info = getInfoQuest(id);
        /*  2845 */
        if (info.length() == 0 || !info.contains(stat)) {
            /*  2846 */
            updateInfoQuest(id, stat + "=" + statData + ((info.length() == 0) ? "" : ";") + info);
            /*       */
        } else {
            /*  2848 */
            String newInfo = stat + "=" + statData;
            /*  2849 */
            String beforeStat = info.substring(0, info.indexOf(stat));
            /*  2850 */
            int from = info.indexOf(";", info.indexOf(stat) + stat.length());
            /*  2851 */
            String afterStat = (from == -1) ? "" : info.substring(from + 1);
            /*  2852 */
            updateInfoQuest(id, beforeStat + newInfo + ((afterStat.length() != 0) ? (";" + afterStat) : ""));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean containsInfoQuest(int questid, String data) {
        /*  2860 */
        return (this.questinfo.containsKey(Integer.valueOf(questid)) && ((String) this.questinfo.get(Integer.valueOf(questid))).contains(data));
        /*       */
    }

    /*       */
    /*       */
    public int getNumQuest() {
        /*  2864 */
        int i = 0;
        /*  2865 */
        for (MapleQuestStatus q : this.quests.values()) {
            /*  2866 */
            if (q.getStatus() == 2 && !q.isCustom()) {
                /*  2867 */
                i++;
                /*       */
            }
            /*       */
        }
        /*  2870 */
        return i;
        /*       */
    }

    /*       */
    /*       */
    public byte getQuestStatus(int questId) {
        /*  2874 */
        MapleQuest qq = MapleQuest.getInstance(questId);
        /*  2875 */
        if (getQuestNoAdd(qq) == null) {
            /*  2876 */
            return 0;
            /*       */
        }
        /*  2878 */
        return getQuestNoAdd(qq).getStatus();
        /*       */
    }

    /*       */
    /*       */
    public MapleQuestStatus getQuest(MapleQuest quest) {
        /*  2882 */
        if (!this.quests.containsKey(Integer.valueOf(quest.getId()))) {
            /*  2883 */
            return new MapleQuestStatus(quest, 0);
            /*       */
        }
        /*  2885 */
        return this.quests.get(Integer.valueOf(quest.getId()));
        /*       */
    }

    /*       */
    /*       */
    public boolean needQuestItem(int questId, int itemId) {
        /*  2889 */
        if (questId <= 0) {
            /*  2890 */
            return true;
            /*       */
        }
        /*  2892 */
        MapleQuest quest = MapleQuest.getInstance(questId);
        /*  2893 */
        return (getInventory(ItemConstants.getInventoryType(itemId)).countById(itemId) < quest.getAmountofItems(itemId));
        /*       */
    }

    /*       */
    /*       */
    public void setQuestAdd(MapleQuest quest, byte status, String customData) {
        /*  2897 */
        if (!this.quests.containsKey(Integer.valueOf(quest.getId()))) {
            /*  2898 */
            MapleQuestStatus stat = new MapleQuestStatus(quest, status);
            /*  2899 */
            stat.setCustomData(customData);
            /*  2900 */
            this.quests.put(Integer.valueOf(quest.getId()), stat);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleQuestStatus getQuestNAdd(MapleQuest quest) {
        /*  2905 */
        if (!this.quests.containsKey(Integer.valueOf(quest.getId()))) {
            /*  2906 */
            MapleQuestStatus status = new MapleQuestStatus(quest, 0);
            /*  2907 */
            this.quests.put(Integer.valueOf(quest.getId()), status);
            /*  2908 */
            return status;
            /*       */
        }
        /*  2910 */
        return this.quests.get(Integer.valueOf(quest.getId()));
        /*       */
    }

    /*       */
    /*       */
    public MapleQuestStatus getQuestNoAdd(MapleQuest quest) {
        /*  2914 */
        return this.quests.get(Integer.valueOf(quest.getId()));
        /*       */
    }

    /*       */
    /*       */
    public MapleQuestStatus getQuestRemove(MapleQuest quest) {
        /*  2918 */
        return this.quests.remove(Integer.valueOf(quest.getId()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateQuest(MapleQuestStatus quest) {
        /*  2925 */
        updateQuest(quest, false);
        /*       */
    }

    /*       */
    /*       */
    public void updateQuest(MapleQuestStatus quest, boolean update) {
        /*  2929 */
        this.quests.put(Integer.valueOf(quest.getQuest().getId()), quest);
        /*  2930 */
        if (!quest.isCustom()) {
            /*  2931 */
            this.client.announce(MaplePacketCreator.updateQuest(quest));
            /*  2932 */
            if (quest.getStatus() == 1 && !update) {
                /*  2933 */
                this.client.announce(MaplePacketCreator.updateQuestInfo(quest.getQuest().getId(), quest.getNpc(), 0, (quest.getStatus() == 1)));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, String> getInfoQuest_Map() {
        /*  2939 */
        return this.questinfo;
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, MapleQuestStatus> getQuest_Map() {
        /*  2943 */
        return this.quests;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void startFishingTask() {
        /*  2950 */
        if (FishingConfig.FISHING_ENABLE) {
            /*  2951 */
            cancelFishingTask();
            /*  2952 */
            this.lastFishingTime = System.currentTimeMillis();
            /*  2953 */
            int fishingTime = isGM() ? FishingConfig.FISHING_TIME_GM : (this.stats.canFishVIP ? FishingConfig.FISHING_TIME_VIP : FishingConfig.FISHING_TIME);
            /*  2954 */
            dropMessage(-1, "开始钓鱼，当前钓鱼间隔时长为：" + (fishingTime / 1000) + "秒。");
            /*  2955 */
            dropMessage(-11, "开始钓鱼，当前钓鱼间隔时长为：" + (fishingTime / 1000) + "秒。");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean canFish(long now) {
        /*  2960 */
        if (!FishingConfig.FISHING_ENABLE) {
            /*  2961 */
            return false;
            /*       */
        }
        /*  2963 */
        int fishingTime = isGM() ? FishingConfig.FISHING_TIME_GM : (this.stats.canFishVIP ? FishingConfig.FISHING_TIME_VIP : FishingConfig.FISHING_TIME);
        /*  2964 */
        return (this.lastFishingTime > 0L && this.lastFishingTime + fishingTime < now);
        /*       */
}

    /*       */
    public void doFish(long now) {
        this.lastFishingTime = now;
        boolean expMulti = this.haveItem(2300001, 1, false, true);
        if (this.client != null && this.client.getPlayer() != null && this.client.isReceiving() && GameConstants.isFishingMap(this.getMapId()) && this.stats.canFish) {
            if (!expMulti && !this.haveItem(2300000, 1, false, true)) {
                this.cancelFishingTask();
                this.dropSpouseMessage(24, "[\u9493\u9c7c\u7cfb\u7edf] \u9c7c\u9975\u4e0d\u8db3\uff0c\u5df2\u505c\u6b62\u9493\u9c7c\u3002");
            } else if (this.chair <= 0) {
                this.cancelFishingTask();
                this.dropSpouseMessage(24, "[\u9493\u9c7c\u7cfb\u7edf] \u672a\u5750\u5728\u6905\u5b50\u4e0a\uff0c\u5df2\u505c\u6b62\u9493\u9c7c\u3002");
            } else {
                MapleInventoryManipulator.removeById(this.client, MapleInventoryType.USE, expMulti ? 2300001 : 2300000, 1, false, false);
                int chance = this.isGM() ? FishingConfig.FISHING_CHANCE_GM : (this.stats.canFishVIP ? FishingConfig.FISHING_CHANCE_VIP : FishingConfig.FISHING_CHANCE);
                if (Randomizer.nextInt(100) > chance) {
                    this.dropSpouseMessage(24, "[\u9493\u9c7c\u7cfb\u7edf] \u9c7c\u513f\u594b\u529b\u6323\u624e\u4e86\u4e00\u756a\u9003\u8dd1\u4e86\u3002");
                } else {
                    MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
                    RewardDropEntry drop = MapleMonsterInformationProvider.getInstance().getReward(this.mapid, expMulti ? 2300001 : 2300000);
                    if (drop != null && ii.itemExists(drop.itemId)) {
                        if (!MapleInventoryManipulator.checkSpace(this.client, drop.itemId, 1, "")) {
                            this.cancelFishingTask();
                            this.dropSpouseMessage(24, "[\u9493\u9c7c\u7cfb\u7edf] \u80cc\u5305\u7a7a\u95f4\u4e0d\u8db3\uff0c\u5df2\u505c\u6b62\u9493\u9c7c\u3002");
                        } else {
                            Object item;
                            if (ItemConstants.getInventoryType(drop.itemId) == MapleInventoryType.EQUIP) {
                                item = ii.randomizeStats((Equip)ii.getEquipById(drop.itemId));
                                if (drop.state > 0) {
                                    ii.setPotentialState((Equip)item, drop.state);
                                }

                                if (drop.period > 0) {
                                    ((Item)item).setExpiration(System.currentTimeMillis() + (long)(drop.period * 24 * 60 * 60 * 1000));
                                }

                                ((Item)item).setGMLog("\u9493\u9c7c\u83b7\u5f97 \u65f6\u95f4 " + DateUtil.getCurrentDate());
                                MapleInventoryManipulator.addbyItem(this.client, (Item)item);
                            } else {
                                item = new Item(drop.itemId, (short)0, (short)1, (short)0);
                                MapleInventoryManipulator.addById(this.client, drop.itemId, (short)1, "\u9493\u9c7c\u83b7\u5f97 \u65f6\u95f4 " + DateUtil.getCurrentDate());
                            }

                            if (drop.msgType != 1 && drop.msgType != 2 && drop.msgType != 3) {
                                this.dropMessage(5, "[\u9493\u9c7c\u7cfb\u7edf] \u83b7\u5f97 " + ii.getName(((Item)item).getItemId()));
                            } else {
                                WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.getGachaponMega(this.getName(), " : \u9493\u9c7c\u83b7\u5f97{" + ii.getName(((Item)item).getItemId()) + "}\uff01\u5927\u5bb6\u4e00\u8d77\u606d\u559c\u4ed6\uff08\u5979\uff09\u5427\uff01\uff01\uff01\uff01", (Item)item, drop.msgType, this.client.getChannel()));
                            }

                        }
                    } else {
                        boolean expReward = Randomizer.nextBoolean();
                        int experi;
                        if (expReward) {
                            experi = Math.min(Randomizer.nextInt(Math.max(1, (int)Math.abs(this.getExpNeededForLevel() / 250L))), 300000);
                            this.gainExp(expMulti ? (long)(experi * 3 / 2) : (long)experi, true, true, true);
                        } else {
                            experi = Randomizer.rand(expMulti ? 9000 : 6000, expMulti ? 75000 : '\uc350');
                            this.gainMeso((long)experi, true);
                        }

                    }
                }
            }
        } else {
            this.cancelFishingTask();
        }
    }


    /*       */
    /*       */
    /*       */
    public void cancelFishingTask() {
        /*  3036 */
        this.lastFishingTime = 0L;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MaplePlayerBuffManager getBuffManager() {
        /*  3043 */
        return this.buffManager;
        /*       */
    }

    /*       */
    /*       */
    public ArrayList<Pair<MapleBuffStat, MapleBuffStatValueHolder>> getAllEffects() {
        /*  3047 */
        return new ArrayList<>(this.effects);
        /*       */
    }

    /*       */
    /*       */
    public MapleBuffStatValueHolder getBuffStatValueHolder(MapleBuffStat stat) {
        /*  3051 */
        MapleBuffStatValueHolder mbsvh = null;
        /*  3052 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3053 */
            if (buffs == null) {
                /*       */
                continue;
                /*       */
            }
            /*  3056 */
            if (buffs.getLeft() == stat) {
                /*  3057 */
                mbsvh = (MapleBuffStatValueHolder) buffs.getRight();
                /*       */
            }
            /*       */
        }
        /*  3060 */
        return mbsvh;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public final MapleStatEffect getSkillEffect(int skillid) {
        /*  3073 */
        MapleStatEffect effect = null;
        /*       */
        Skill skill;
        /*  3075 */
        if (getTotalSkillLevel(skillid) > 0 && (
                /*  3076 */       skill = SkillFactory.getSkill(skillid)) != null)
            /*       */ {
            /*       */
            /*  3079 */
            effect = skill.getEffect(getTotalSkillLevel(skillid));
            /*       */
        }
        /*       */
        /*  3082 */
        return effect;
        /*       */
    }

    /*       */
    /*       */
    public boolean isActiveBuffedValue(int skillid) {
        /*  3086 */
        return (this.buffManager.isActiveBuffedValue(skillid) && !isGM());
        /*       */
    }

    /*       */
    /*       */
    public Integer getBuffedValueNew(MapleBuffStat effect) {
        /*  3090 */
        return this.buffManager.getBuffedValue(effect);
        /*       */
    }

    /*       */
    /*       */
    public Integer getBuffedValue(MapleBuffStat stat) {
        /*  3094 */
        if (stat.canStack()) {
            /*  3095 */
            int value = 0;
            /*  3096 */
            boolean find = false;
            /*  3097 */
            for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
                /*  3098 */
                if (buffs.getLeft() == stat) {
                    /*  3099 */
                    find = true;
                    /*  3100 */
                    value += ((MapleBuffStatValueHolder) buffs.getRight()).value;
                    /*       */
                }
                /*       */
            }
            /*  3103 */
            return find ? Integer.valueOf(value) : null;
            /*       */
        }
        /*  3105 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3106 */
        if (mbsvh == null) {
            /*  3107 */
            return null;
            /*       */
        }
        /*  3109 */
        return Integer.valueOf(mbsvh.value);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getBuffedIntValue(MapleBuffStat stat) {
        /*  3114 */
        if (stat.canStack()) {
            /*  3115 */
            int value = 0;
            /*  3116 */
            for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
                /*  3117 */
                if (buffs.getLeft() == stat) {
                    /*  3118 */
                    value += ((MapleBuffStatValueHolder) buffs.getRight()).value;
                    /*       */
                }
                /*       */
            }
            /*  3121 */
            return value;
            /*       */
        }
        /*  3123 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3124 */
        if (mbsvh == null) {
            /*  3125 */
            return 0;
            /*       */
        }
        /*  3127 */
        return mbsvh.value;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public Integer getBuffedSkill_X(MapleBuffStat stat) {
        /*  3132 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3133 */
        if (mbsvh == null) {
            /*  3134 */
            return null;
            /*       */
        }
        /*  3136 */
        return Integer.valueOf(mbsvh.effect.getX());
        /*       */
    }

    /*       */
    /*       */
    public Integer getBuffedSkill_Y(MapleBuffStat stat) {
        /*  3140 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3141 */
        if (mbsvh == null) {
            /*  3142 */
            return null;
            /*       */
        }
        /*  3144 */
        return Integer.valueOf(mbsvh.effect.getY());
        /*       */
    }

    /*       */
    /*       */
    public boolean isBuffFromNew(MapleBuffStat stat, Skill skill) {
        /*  3148 */
        return this.buffManager.isBuffFrom(stat, skill.getId());
        /*       */
    }

    /*       */
    /*       */
    public boolean isBuffFrom(MapleBuffStat stat, Skill skill) {
        /*  3152 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3153 */
        return (mbsvh != null && mbsvh.effect != null && skill != null && mbsvh.effect.isSkill() && mbsvh.effect.getSourceid() == skill.getId());
        /*       */
    }

    /*       */
    /*       */
    public boolean hasBuffSkill(int skillId) {
        /*  3157 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3158 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3159 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3161 */
        boolean find = false;
        /*  3162 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3163 */
            if (mbsvh.effect.isSkill() && mbsvh.effect.getSourceid() == skillId) {
                /*  3164 */
                find = true;
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*  3168 */
        allBuffs.clear();
        /*  3169 */
        return find;
        /*       */
    }

    /*       */
    /*       */
    public int getBuffSourceNew(MapleBuffStat stat) {
        /*  3173 */
        return this.buffManager.getBuffSource(stat);
        /*       */
    }

    /*       */
    /*       */
    public int getBuffSource(MapleBuffStat stat) {
        /*  3177 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3178 */
        if (mbsvh == null) {
            /*  3179 */
            return 0;
            /*       */
        }
        /*  3181 */
        return mbsvh.effect.getSourceid();
        /*       */
    }

    /*       */
    /*       */
    public List<MapleStatEffect> getBuffEffects() {
        /*  3185 */
        return this.buffManager.getBuffEffects();
        /*       */
    }

    /*       */
    /*       */
    public int getTrueBuffSource(MapleBuffStat stat) {
        /*  3189 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3190 */
        if (mbsvh == null) {
            /*  3191 */
            return -1;
            /*       */
        }
        /*  3193 */
        return mbsvh.effect.isSkill() ? mbsvh.effect.getSourceid() : -mbsvh.effect.getSourceid();
        /*       */
    }

    /*       */
    /*       */
    public void setBuffedValueNew(MapleBuffStat effect, int value) {
        /*  3197 */
        this.buffManager.setBuffedValue(effect, value);
        /*       */
    }

    /*       */
    /*       */
    public void setBuffedValue(MapleBuffStat stat, int value) {
        /*  3201 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3202 */
        if (mbsvh == null) {
            /*       */
            return;
            /*       */
        }
        /*  3205 */
        mbsvh.value = value;
        /*       */
    }

    /*       */
    /*       */
    public void setSchedule(MapleBuffStat stat, ScheduledFuture<?> sched) {
        /*  3209 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3210 */
        if (mbsvh == null) {
            /*       */
            return;
            /*       */
        }
        /*  3213 */
        mbsvh.schedule.cancel(false);
        /*  3214 */
        mbsvh.schedule = sched;
        /*       */
    }

    /*       */
    /*       */
    public Long getBuffedStartTimeNew(MapleBuffStat effect) {
        /*  3218 */
        return this.buffManager.getBuffedStarttime(effect);
        /*       */
    }

    /*       */
    /*       */
    public Long getBuffedStartTime(MapleBuffStat stat) {
        /*  3222 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3223 */
        if (mbsvh == null) {
            /*  3224 */
            return null;
            /*       */
        }
        /*  3226 */
        return Long.valueOf(mbsvh.startTime);
        /*       */
    }

    /*       */
    /*       */
    public MapleStatEffect getStatForBuffNew(MapleBuffStat effect) {
        /*  3230 */
        return this.buffManager.getStatForBuff(effect);
        /*       */
    }

    /*       */
    /*       */
    public MapleStatEffect getStatForBuff(MapleBuffStat stat) {
        /*  3234 */
        MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
        /*  3235 */
        if (mbsvh == null) {
            /*  3236 */
            return null;
            /*       */
        }
        /*  3238 */
        return mbsvh.effect;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void registerEffect(MapleStatEffect effect, long starttime, ScheduledFuture<?> schedule, List<Pair<MapleBuffStat, Integer>> stat) {
        /*  3245 */
        afterRegister(effect);
        /*  3246 */
        this.buffManager.registerEffect(effect, starttime, schedule, stat);
        /*  3247 */
        this.stats.recalcLocalStats(this);
        /*       */
    }

    /*       */
    /*       */
    public void registerEffect(MapleStatEffect effect, long starttime, ScheduledFuture<?> schedule, int from) {
        /*  3251 */
        registerEffect(effect, starttime, schedule, effect.getStatups(), false, effect.getDuration(), from);
        /*       */
    }

    /*       */
    /*       */
    public void registerEffect(MapleStatEffect effect, long starttime, ScheduledFuture<?> schedule, Map<MapleBuffStat, Integer> statups, boolean silent, int localDuration, int from) {
        /*  3255 */
        afterRegister(effect);
        /*  3256 */
        statups.forEach((left, right) -> this.effects.add(new Pair(left, new MapleBuffStatValueHolder(effect, starttime, schedule, right.intValue(), localDuration, from))));
        /*  3257 */
        if (!silent && !effect.is血之契约()) {
            /*  3258 */
            this.stats.recalcLocalStats(this);
            /*       */
        }
        /*  3260 */
        if (isShowPacket()) {
            /*  3261 */
            dropDebugMessage(1, "[BUFF注册] 注册BUFF效果 - 当前BUFF总数: " + this.effects.size() + " 技能ID: " + effect.getSourceid());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    private void afterRegister(MapleStatEffect effect) {
        /*  3266 */
        if (effect.is隐藏术()) {
            /*  3267 */
            this.map.broadcastMessage(this, MaplePacketCreator.removePlayerFromMap(getId()), false);
            /*  3268 */
        } else if (effect.is龙之力()) {
            /*  3269 */
            prepareDragonBlood();
            /*  3270 */
        } else if (effect.is团队治疗()) {
            /*  3271 */
            prepareRecovery();
            /*  3272 */
        } else if (effect.is重生契约状态()) {
            /*  3273 */
            checkBerserk();
            /*  3274 */
        } else if (effect.is骑兽技能_()) {
            /*  3275 */
            getMount().startSchedule();
            /*  3276 */
        } else if (effect.is恶魔恢复()) {
            /*  3277 */
            prepareRecoveryEM();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public List<MapleBuffStat> getBuffStats(MapleStatEffect effect, long startTime) {
        /*  3282 */
        List<MapleBuffStat> ret = new ArrayList<>();
        /*  3283 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> stateffect : getAllEffects()) {
            /*  3284 */
            MapleBuffStatValueHolder mbsvh = (MapleBuffStatValueHolder) stateffect.getRight();
            /*  3285 */
            if (mbsvh.effect.sameSource(effect) && (startTime == -1L || startTime == mbsvh.startTime)) {
                /*  3286 */
                ret.add(stateffect.getLeft());
                /*       */
            }
            /*       */
        }
        /*  3289 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public SpecialBuffInfo getStackBuffInfo(MapleBuffStat stat, int n2) {
        /*  3293 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> stateffect : getAllEffects()) {
            /*  3294 */
            MapleBuffStat buffStat = (MapleBuffStat) stateffect.getLeft();
            /*  3295 */
            MapleBuffStatValueHolder mbsvh = (MapleBuffStatValueHolder) stateffect.getRight();
            /*  3296 */
            int sourceid = mbsvh.effect.getSourceid();
            /*  3297 */
            Integer n4 = null;
            /*  3298 */
            if (SkillConstants.c(buffStat)) {
                /*  3299 */
                if (n2 == sourceid && stat == buffStat) {
                    /*  3300 */
                    if (sourceid == 11121011 && buffStat == MapleBuffStat.月光转换) {
                        /*  3301 */
                        sourceid = 11111022;
                        /*  3302 */
                    } else if (sourceid == 11121012 && buffStat == MapleBuffStat.月光转换) {
                        /*  3303 */
                        sourceid = 11101022;
                        /*  3304 */
                    } else if ((sourceid == 11121012 || sourceid == 11121011) && buffStat == MapleBuffStat.霰弹炮) {
                        /*  3305 */
                        sourceid = (sourceid == 11121012) ? 11101022 : 11121011;
                        /*  3306 */
                    } else if (sourceid == 51001011 || sourceid == 51001012 || sourceid == 51001013 || sourceid == 51111011 || sourceid == 51111012) {
                        /*  3307 */
                        sourceid = 51001005;
                        /*  3308 */
                        mbsvh.fromChrId = 12000;
                        /*  3309 */
                    } else if (sourceid == 1320019) {
                        /*  3310 */
                        n4 = Integer.valueOf(1);
                        /*       */
                    }
                    /*       */
                    /*  3313 */
                    return new SpecialBuffInfo(mbsvh.effect.isSkill() ? sourceid : -sourceid, (n4 != null) ? n4.intValue() : mbsvh.value, mbsvh.fromChrId, (int) mbsvh.startTime);
                    /*       */
                }
                /*  3315 */
                switch (n2) {
                    /*       */
                    case 21120019:
                        /*       */
                    case 21120023:
                        /*  3318 */
                        return new SpecialBuffInfo(mbsvh.effect.isSkill() ? sourceid : -sourceid, (n4 != null) ? n4.intValue() : mbsvh.value, mbsvh.fromChrId, (int) mbsvh.startTime);
                    /*       */
                }
                /*       */
                /*       */
            }
            /*       */
        }
        /*  3323 */
        return null;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<SpecialBuffInfo> getSpecialBuffInfo(MapleBuffStat stat) {
        /*  3330 */
        List<SpecialBuffInfo> ret = new ArrayList<>();
        /*  3331 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> stateffect : getAllEffects()) {
            /*  3332 */
            MapleBuffStatValueHolder mbsvh = (MapleBuffStatValueHolder) stateffect.getRight();
            /*  3333 */
            int skillId = mbsvh.effect.getSourceid();
            /*  3334 */
            if (stateffect.getLeft() == stat) {
                /*  3335 */
                ret.add(new SpecialBuffInfo(mbsvh.effect.isSkill() ? skillId : -skillId, mbsvh.value, mbsvh.localDuration, mbsvh.startTime));
                /*       */
            }
            /*       */
        }
        /*  3338 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<SpecialBuffInfo> getSpecialBuffInfo(MapleBuffStat stat, int buffid, int value, int bufflength) {
        /*  3358 */
        List<SpecialBuffInfo> ret = new ArrayList<>();
        /*  3359 */
        long time = System.currentTimeMillis();
        /*  3360 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> stateffect : getAllEffects()) {
            /*  3361 */
            MapleBuffStatValueHolder mbsvh = (MapleBuffStatValueHolder) stateffect.getRight();
            /*  3362 */
            int skillId = mbsvh.effect.getSourceid();
            /*  3363 */
            if (stateffect.getLeft() == stat && skillId != Math.abs(buffid)) {
                /*  3364 */
                ret.add(new SpecialBuffInfo(mbsvh.effect.isSkill() ? skillId : -skillId, mbsvh.value, mbsvh.localDuration, mbsvh.startTime));
                /*       */
            }
            /*       */
        }
        /*  3367 */
        ret.add(new SpecialBuffInfo(buffid, value, bufflength, time));
        /*  3368 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    private void deregisterBuffStats(List<MapleBuffStat> stats, MapleStatEffect effect, boolean overwrite) {
        int effectSize = this.effects.size();
        ArrayList<Pair<MapleBuffStat, MapleBuffStatValueHolder>> effectsToRemove = new ArrayList<>();
        stats.forEach((stat) -> {
            this.getAllEffects().forEach((buffs) -> {
                if (buffs.getLeft() == stat && (effect == null || ((MapleBuffStatValueHolder)buffs.getRight()).effect.sameSource(effect))) {
                    effectsToRemove.add(buffs);
                    MapleBuffStatValueHolder mbsvh = (MapleBuffStatValueHolder)buffs.getRight();
                    if (stat != MapleBuffStat.IndieSummoned && stat != MapleBuffStat.灵魂助力 && stat != MapleBuffStat.DAMAGE_BUFF && stat != MapleBuffStat.地雷 && stat != MapleBuffStat.增加物理攻击力 && stat != MapleBuffStat.影子侍从 && stat != MapleBuffStat.召唤美洲豹) {
                        if (stat == MapleBuffStat.属性攻击) {
                            this.lastDragonBloodTime = 0L;
                        } else if (stat != MapleBuffStat.恢复效果 && mbsvh.effect.getSourceid() != 35111003) {
                            if (stat != MapleBuffStat.导航辅助 && stat != MapleBuffStat.神秘瞄准术) {
                                if (stat == MapleBuffStat.恶魔恢复) {
                                    this.lastRecoveryTimeEM = 0L;
                                } else if (stat == MapleBuffStat.避柳) {
                                    this.setBuffedValue(stat, 0);
                                }
                            } else {
                                this.linkMobs.clear();
                            }
                        } else {
                            this.lastRecoveryTime = 0L;
                        }
                    } else {
                        int summonId = mbsvh.effect.getSourceid();
                        List<MapleSummon> toRemove = new ArrayList();
                        this.visibleMapObjectsLock.writeLock().lock();
                        this.summonsLock.writeLock().lock();

                        try {
                            Iterator var9 = this.summons.iterator();

                            label224:
                            while(true) {
                                MapleSummon summon;
                                do {
                                    if (!var9.hasNext()) {
                                        var9 = toRemove.iterator();

                                        while(var9.hasNext()) {
                                            summon = (MapleSummon)var9.next();
                                            this.summons.remove(summon);
                                        }
                                        break label224;
                                    }

                                    summon = (MapleSummon)var9.next();
                                    if (summon.getSkillId() == summonId || (summonId == 86 || summonId == 88 || summonId == 91) && summon.getSkillId() == summonId + 999 || (summonId == 1085 || summonId == 1087 || summonId == 1090) && summon.getSkillId() == summonId - 999) {
                                        break;
                                    }
                                } while(!SkillConstants.is美洲豹(summon.getSkillId()) && summonId != 23111008 && summonId != 23111009 && summonId != 23111010);

                                this.map.broadcastMessage(SummonPacket.removeSummon(summon, overwrite));
                                this.map.removeMapObject(summon);
                                this.visibleMapObjects.remove(summon);
                                toRemove.add(summon);
                            }
                        } finally {
                            this.summonsLock.writeLock().unlock();
                            this.visibleMapObjectsLock.writeLock().unlock();
                        }

                        if (summonId == 3111005 || summonId == 3211005) {
                            this.cancelEffectFromBuffStat(MapleBuffStat.精神连接);
                        }
                    }
                }

            });
        });

        int toRemoveSize = effectsToRemove.size();
        effectsToRemove.forEach(toRemove -> {
            if (this.effects.contains(toRemove)) {
                if (((MapleBuffStatValueHolder)toRemove.getRight()).schedule != null) {
                    ((MapleBuffStatValueHolder)toRemove.getRight()).schedule.cancel(false);
                    ((MapleBuffStatValueHolder)toRemove.getRight()).schedule = null;
                }
                this.effects.remove(toRemove);
            }
        });
        effectsToRemove.clear();
        boolean ok = (effectSize - this.effects.size() == toRemoveSize);
        if(this.isShowPacket()) {
            this.dropDebugMessage(1, "[BUFF\u4fe1\u606f] \u53d6\u6d88BUFF \u4ee5\u524dBUFF\u603b\u6570: " + effectSize + " \u73b0\u5728BUFF\u603b\u6570 " + this.effects.size() + " \u53d6\u6d88\u7684BUFF\u6570\u91cf: " + toRemoveSize + " \u662f\u5426\u76f8\u540c: " + ok);
        }


        if(!ok && ServerConfig.DEBUG_MODE) {
            log.error("\u53d6\u6d88BUFF\u9519\u8bef", this.getName() + " - " + this.getJob() + " \u53d6\u6d88BUFF\u51fa\u73b0\u9519\u8bef \u6280\u80fdID: " + (effect != null ? effect.getSourceid() : "???"), true);
        }

    }


    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelEffect(MapleStatEffect effect, boolean overwrite, long startTime) {
        /*  3456 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /*  3459 */
        cancelEffect(effect, overwrite, startTime, effect.getStatups());
        /*       */
    }

    /*       */
    public void cancelEffect(MapleStatEffect effect, boolean overwrite, long startTime, Map<MapleBuffStat, Integer> statups) {
        /*       */
        List<MapleBuffStat> buffstats;
        /*  3463 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  3467 */
        if (!overwrite) {
            /*  3468 */
            buffstats = getBuffStats(effect, startTime);
            /*       */
        } else {
            /*  3470 */
            buffstats = new ArrayList<>(statups.size());
            /*  3471 */
            buffstats.addAll(statups.keySet());
            /*       */
        }
        /*  3473 */
        if (ServerConstants.isShowPacket()) {
            /*  3474 */
            log.info("取消技能BUFF: - buffstats.size() " + buffstats.size());
            /*       */
        }
        /*  3476 */
        if (buffstats.size() <= 0) {
            /*  3477 */
            if (effect.is战法灵气()) {
                /*  3478 */
                cancelEffectFromBuffStat(MapleBuffStat.战法灵气);
                /*  3479 */
            } else if (effect.is狂风肆虐()) {
                /*  3480 */
                cancelEffectFromBuffStat(MapleBuffStat.狂风肆虐);
                /*       */
            }
            /*       */
            return;
            /*       */
        }
        /*  3484 */
        if (ServerConstants.isShowPacket()) {
            /*  3485 */
            log.info("开始取消技能BUFF: - 1");
            /*       */
        }
        /*  3487 */
        if (effect.is终极无限() && getBuffedValue(MapleBuffStat.终极无限) != null) {
            /*  3488 */
            int duration = Math.max(effect.getDuration(), effect.alchemistModifyVal(this, effect.getDuration(), false));
            /*  3489 */
            long start = getBuffedStartTime(MapleBuffStat.终极无限).longValue();
            /*  3490 */
            duration += (int) (start - System.currentTimeMillis());
            /*  3491 */
            if (duration > 0) {
                /*  3492 */
                int neworbcount = getBuffedValue(MapleBuffStat.终极无限).intValue() + effect.getDamage();
                /*  3493 */
                Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.终极无限, Integer.valueOf(neworbcount));
                /*  3494 */
                setBuffedValue(MapleBuffStat.终极无限, neworbcount);
                /*       */
                /*  3496 */
                addHP((int) (effect.getHpR() * this.stats.getCurrentMaxHp()));
                /*  3497 */
                addMP((int) (effect.getMpR() * this.stats.getCurrentMaxMp(getJob())));
                /*  3498 */
                setSchedule(MapleBuffStat.终极无限, Timer.BuffTimer.getInstance().schedule((Runnable) new MapleStatEffect.CancelEffectAction(this, effect, start, stat), effect.alchemistModifyVal(this, 4000, false)));
                /*       */
                /*       */
                return;
                /*       */
            }
            /*       */
        }
        /*  3503 */
        if (effect.getSourceid() == 151100002) {
            /*  3504 */
            int duration = Math.max(effect.getDuration(), effect.alchemistModifyVal(this, effect.getDuration(), false));
            /*  3505 */
            long start = getBuffedStartTime(MapleBuffStat.终极无限).longValue();
            /*  3506 */
            duration += (int) (start - System.currentTimeMillis());
            /*       */
        }
        /*       */
        /*       */
        /*  3510 */
        deregisterBuffStats(buffstats, effect, overwrite);
        /*  3511 */
        if (effect.is时空门()) {
            /*  3512 */
            if (!getDoors().isEmpty()) {
                /*  3513 */
                removeDoor();
                /*  3514 */
                silentPartyUpdate();
                /*       */
            }
            /*  3516 */
        } else if (effect.is机械传送门()) {
            /*  3517 */
            if (!getMechDoors().isEmpty()) {
                /*  3518 */
                removeMechDoor();
                /*       */
            }
            /*  3520 */
        } else if (effect.is骑兽技能_()) {
            /*  3521 */
            getMount().cancelSchedule();
            /*  3522 */
        } else if (effect.is金属机甲()) {
            /*  3523 */
            cancelEffectFromBuffStat(MapleBuffStat.金属机甲);
            /*  3524 */
        } else if (effect.is拔刀姿势() && !overwrite) {
            /*  3525 */
            cancelEffectFromBuffStat(MapleBuffStat.拔刀术加成);
            /*  3526 */
            SkillFactory.getSkill(40011291).getEffect(1).applyTo(this);
            /*  3527 */
        } else if (effect.is钢铁之躯()) {
            /*  3528 */
            getSpecialStat().setManOfSteel(0);
            /*       */
        }
        /*       */
        /*  3531 */
        cancelPlayerBuffs(buffstats, overwrite);
        /*  3532 */
        if (!overwrite &&
                /*  3533 */       effect.is隐藏术() && this.client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null) {
            /*  3534 */
            this.map.broadcastMessage(this, MaplePacketCreator.spawnPlayerMapobject(this), false);
            /*  3535 */
            this.map.broadcastMessage(this, EffectPacket.getEffectSwitch(getId(), getEffectSwitch()), true);
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /*  3541 */
        if (effect.is夜光平衡() && !overwrite) {
            /*  3542 */
            int skillId = (effect.getSourceid() == 20040219) ? 20040217 : 20040216;
            /*  3543 */
            SkillFactory.getSkill(skillId).getEffect(1).applyTo(this);
            /*  3544 */
        } else if (effect.is狂龙变形() || effect.is狂龙超级变形()) {
            /*  3545 */
            if (getBuffedValue(MapleBuffStat.剑刃之壁) != null) {
                /*  3546 */
                SkillFactory.getSkill(61101002).getEffect(getSkillLevel(61101002)).applyTo(this);
                /*       */
            }
            /*  3548 */
        } else if (effect.is攻势之盾() && !overwrite) {
            /*  3549 */
            getClient().getSession().write(MaplePacketCreator.userBonusAttackRequest(400001011, 0, new ArrayList()));
            /*       */
        }
        /*  3551 */
        if (isShowPacket()) {
            /*  3552 */
            dropDebugMessage(1, "[BUFF信息] 取消BUFF 当前BUFF总数: " + this.effects.size() + " 技能: " + effect.getSourceid());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelBuffStats(MapleBuffStat... stat) {
        /*  3560 */
        List<MapleBuffStat> buffStatList = Arrays.asList(stat);
        /*  3561 */
        deregisterBuffStats(buffStatList, (MapleStatEffect) null, false);
        /*  3562 */
        cancelPlayerBuffs(buffStatList, false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelEffectFromBuffStatNew(MapleBuffStat stat) {
        /*  3569 */
        MaplePlayerBuffManager.MapleBuff buff = this.buffManager.getBuff(stat);
        /*  3570 */
        if (buff != null) {
            /*  3571 */
            cancelEffect(buff.getEffect(), false, -1L);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void cancelEffectFromBuffStat(MapleBuffStat stat) {
        /*  3576 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3577 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3578 */
            if (buffs.getLeft() == stat) {
                /*  3579 */
                allBuffs.add(buffs.getRight());
                /*       */
            }
            /*       */
        }
        /*  3582 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3583 */
            cancelEffect(mbsvh.effect, false, -1L);
            /*       */
        }
        /*  3585 */
        allBuffs.clear();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelEffectFromBuffStat(MapleBuffStat stat, int from) {
        /*  3592 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3593 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3594 */
            if (buffs.getLeft() == stat && ((MapleBuffStatValueHolder) buffs.getRight()).fromChrId == from) {
                /*  3595 */
                allBuffs.add(buffs.getRight());
                /*       */
            }
            /*       */
        }
        /*  3598 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3599 */
            cancelEffect(mbsvh.effect, false, -1L);
            /*       */
        }
        /*  3601 */
        allBuffs.clear();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    private void cancelPlayerBuffs(List<MapleBuffStat> buffstats, boolean overwrite) {
        /*  3648 */
        boolean write = (this.client != null && this.client.getChannelServer() != null && this.client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null);
        /*  3649 */
        if (write) {
            /*  3650 */
            if (buffstats.contains(MapleBuffStat.导航辅助)) {
                /*  3651 */
                this.client.announce(BuffPacket.cancelBuff(MapleBuffStat.导航辅助));
                /*       */
                return;
                /*       */
            }
            /*  3654 */
            if (buffstats.contains(MapleBuffStat.元素属性)) {
                /*  3655 */
                this.buffValue = 0;
                /*       */
            }
            /*  3657 */
            if (buffstats.contains(MapleBuffStat.IndieSummoned)) {
                /*  3658 */
                buffstats.remove(MapleBuffStat.IndieSummoned);
                /*  3659 */
                if (buffstats.size() <= 0) {
                    /*       */
                    return;
                    /*       */
                }
                /*       */
            }
            /*  3663 */
            if (overwrite) {
                /*  3664 */
                List<MapleBuffStat> buffStatX = new ArrayList<>();
                /*  3665 */
                for (MapleBuffStat stat : buffstats) {
                    /*  3666 */
                    if (stat.canStack()) {
                        /*  3667 */
                        buffStatX.add(stat);
                        /*       */
                    }
                    /*       */
                }
                /*  3670 */
                if (buffStatX.size() <= 0 || buffstats.contains(MapleBuffStat.击杀点数)) {
                    /*  3671 */
                    if (isShowPacket()) {
                        /*  3672 */
                        dropDebugMessage(1, "[BUFF信息] 取消BUFF - 不发送封包");
                        /*       */
                    }
                    /*       */
                    return;
                    /*       */
                }
                /*  3676 */
                buffstats = buffStatX;
                /*       */
            }
            /*       */
            /*  3679 */
            if (isShowPacket()) {
                /*  3680 */
                dropDebugMessage(1, "[BUFF信息] 取消BUFF效果 - 发送封包 - 是否注册BUFF时间: " + overwrite);
                /*       */
            }
            /*  3682 */
            this.stats.recalcLocalStats(this);
            /*  3683 */
            if (!buffstats.isEmpty() && this.client != null) {
                /*  3684 */
                this.client.announce(BuffPacket.cancelBuff(buffstats, this));
                /*  3685 */
                if (this.map != null) {
                    /*  3686 */
                    this.map.broadcastMessage(this, BuffPacket.cancelForeignBuff(this, buffstats), false);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  3691 */
                if (buffstats.contains(MapleBuffStat.元素冲击)) {
                    /*  3692 */
                    if (getBuffedValue(MapleBuffStat.强化祝福之锤) != null) {
                        /*  3693 */
                        cancelEffectFromBuffStat(MapleBuffStat.强化祝福之锤);
                        /*       */
                    } else {
                        /*       */
                        /*  3696 */
                        this.client.announce(BuffPacket.cancelBuff(MapleBuffStat.强化祝福之锤));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dispelNew() {
        /*  3707 */
        this.buffManager.dispel();
        /*       */
    }

    /*       */
    /*       */
    public void dispel() {
        /*  3711 */
        if (!isHidden()) {
            /*  3712 */
            LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
            /*  3713 */
            for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
                /*  3714 */
                allBuffs.add(buffs.getRight());
                /*       */
            }
            /*  3716 */
            for (MapleBuffStatValueHolder mbsvh : allBuffs) {
                /*  3717 */
                if (mbsvh.effect.isSkill() && mbsvh.schedule != null && !mbsvh.effect.isMorph() && !mbsvh.effect.isGmBuff() && !mbsvh.effect.is骑兽技能() && !mbsvh.effect.is能量获得() && !mbsvh.effect.is矛连击强化() && !mbsvh.effect.is尖兵支援() && !mbsvh.effect.isNotRemoved()) {
                    /*  3718 */
                    cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dispelSkillNew(int skillid) {
        /*  3728 */
        this.buffManager.dispelSkill(skillid);
        /*       */
    }

    /*       */
    /*       */
    public void dispelSkill(int skillId) {
        /*  3732 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3733 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3734 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3736 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3737 */
            if (mbsvh.effect.isSkill() && mbsvh.effect.getSourceid() == skillId) {
                /*  3738 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dispelBuffByJobId(int jobId) {
        /*  3748 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3749 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3750 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3752 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3753 */
            if (mbsvh.effect.isSkill() && mbsvh.effect.getSourceid() / 10000 == jobId) {
                /*  3754 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dispelSummons() {
        /*  3763 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3764 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3765 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3767 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3768 */
            if (mbsvh.effect.getSummonMovementType() != null) {
                /*  3769 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dispelSummons(int skillId) {
        /*  3778 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3779 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3780 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3782 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3783 */
            if (mbsvh.effect.getSummonMovementType() != null && mbsvh.effect.getSourceid() == skillId) {
                /*  3784 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dispelBuff(int buffId) {
        /*  3794 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3795 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3796 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3798 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3799 */
            if (mbsvh.effect.getSourceid() == buffId) {
                /*  3800 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelAllBuffs_() {
        /*  3810 */
        this.effects.clear();
        /*  3811 */
        cannelAutoCelebrityCrit();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelAllBuffsNew() {
        /*  3818 */
        this.buffManager.cancelAllBuffs();
        /*       */
    }

    /*       */
    /*       */
    public void cancelAllBuffs() {
        /*  3822 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3823 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3824 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3826 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3827 */
            cancelEffect(mbsvh.effect, false, mbsvh.startTime);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelMorphsNew() {
        /*  3835 */
        this.buffManager.cancelMorphs();
        /*       */
    }

    /*       */
    /*       */
    public void cancelMorphs() {
        /*  3839 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3840 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3841 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3843 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3844 */
            switch (mbsvh.effect.getSourceid()) {
                /*       */
                case 61111008:
                    /*       */
                case 61120008:
                    /*       */
                case 61121053:
                    /*       */
                    return;
                /*       */
            }
            /*  3850 */
            if (mbsvh.effect.isMorph()) {
                /*  3851 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getMorphState() {
        /*  3861 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3862 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3863 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3865 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3866 */
            if (mbsvh.effect.isMorph()) {
                /*  3867 */
                return mbsvh.effect.getSourceid();
                /*       */
            }
            /*       */
        }
        /*  3870 */
        return -1;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void silentGiveBuffs(List<PlayerBuffValueHolder> buffs) {
        /*  3884 */
        if (buffs == null) {
            /*       */
            return;
            /*       */
        }
        /*  3887 */
        for (PlayerBuffValueHolder mbsvh : buffs) {
            /*  3888 */
            mbsvh.effect.silentApplyBuff(this, mbsvh.startTime, mbsvh.localDuration, mbsvh.statup, mbsvh.fromChrId);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public List<PlayerBuffValueHolder> getAllBuffs() {
        /*  3893 */
        List<PlayerBuffValueHolder> ret = new ArrayList<>();
        /*  3894 */
        Map<Pair<Integer, Byte>, Integer> alreadyDone = new HashMap<>();
        /*  3895 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> mbsvh : getAllEffects()) {
            /*  3896 */
            Pair<Integer, Byte> key = new Pair(Integer.valueOf(((MapleBuffStatValueHolder) mbsvh.getRight()).effect.getSourceid()), Byte.valueOf(((MapleBuffStatValueHolder) mbsvh.getRight()).effect.getLevel()));
            /*  3897 */
            if (alreadyDone.containsKey(key)) {
                /*  3898 */
                ((PlayerBuffValueHolder) ret.get(((Integer) alreadyDone.get(key)).intValue())).statup.put(mbsvh.getLeft(), Integer.valueOf(((MapleBuffStatValueHolder) mbsvh.getRight()).value));
                continue;
                /*       */
            }
            /*  3900 */
            alreadyDone.put(key, Integer.valueOf(ret.size()));
            /*  3901 */
            Map<MapleBuffStat, Integer> list = new EnumMap<>(MapleBuffStat.class);
            /*  3902 */
            list.put(mbsvh.getLeft(), Integer.valueOf(((MapleBuffStatValueHolder) mbsvh.getRight()).value));
            /*  3903 */
            ret.add(new PlayerBuffValueHolder(((MapleBuffStatValueHolder) mbsvh.getRight()).startTime, ((MapleBuffStatValueHolder) mbsvh.getRight()).effect, list, ((MapleBuffStatValueHolder) mbsvh.getRight()).localDuration, ((MapleBuffStatValueHolder) mbsvh.getRight()).fromChrId));
            /*       */
        }
        /*       */
        /*  3906 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> mbsvh : getAllEffects()) {
            /*  3907 */
            if (((MapleBuffStatValueHolder) mbsvh.getRight()).schedule != null) {
                /*  3908 */
                ((MapleBuffStatValueHolder) mbsvh.getRight()).schedule.cancel(false);
                /*  3909 */
                ((MapleBuffStatValueHolder) mbsvh.getRight()).schedule = null;
                /*       */
            }
            /*       */
        }
        /*  3912 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cancelMagicDoor() {
        /*  3919 */
        LinkedList<MapleBuffStatValueHolder> allBuffs = new LinkedList<>();
        /*  3920 */
        for (Pair<MapleBuffStat, MapleBuffStatValueHolder> buffs : getAllEffects()) {
            /*  3921 */
            allBuffs.add(buffs.getRight());
            /*       */
        }
        /*  3923 */
        for (MapleBuffStatValueHolder mbsvh : allBuffs) {
            /*  3924 */
            if (mbsvh.effect.is时空门()) {
                /*  3925 */
                cancelEffect(mbsvh.effect, false, mbsvh.startTime);
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void doDragonBlood() {
        /*  3935 */
        MapleStatEffect bloodEffect = getStatForBuff(MapleBuffStat.属性攻击);
        /*  3936 */
        if (bloodEffect == null) {
            /*  3937 */
            this.lastDragonBloodTime = 0L;
            /*       */
            return;
            /*       */
        }
        /*  3940 */
        prepareDragonBlood();
        /*  3941 */
        if (this.stats.getHp() - bloodEffect.getStr() <= 1) {
            /*  3942 */
            cancelBuffStats(new MapleBuffStat[]{MapleBuffStat.属性攻击});
            /*       */
        } else {
            /*  3944 */
            addHP(-bloodEffect.getStr());
            /*  3945 */
            this.client.announce(EffectPacket.showOwnBuffEffect(bloodEffect.getSourceid(), EffectOpcode.UserEffect_Quest.getValue(), getLevel(), bloodEffect.getLevel()));
            /*  3946 */
            this.map.broadcastMessage(this, EffectPacket.showBuffeffect(this, bloodEffect.getSourceid(), EffectOpcode.UserEffect_Quest.getValue(), getLevel(), bloodEffect.getLevel()), false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean canBlood(long now) {
        /*  3951 */
        return (this.lastDragonBloodTime > 0L && this.lastDragonBloodTime + 4000L < now);
        /*       */
    }

    /*       */
    /*       */
    private void prepareDragonBlood() {
        /*  3955 */
        this.lastDragonBloodTime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    public void doRecovery() {
        /*  3959 */
        MapleStatEffect bloodEffect = getStatForBuff(MapleBuffStat.恢复效果);
        /*  3960 */
        if (bloodEffect == null) {
            /*  3961 */
            bloodEffect = getStatForBuff(MapleBuffStat.金属机甲);
            /*  3962 */
            if (bloodEffect == null) {
                /*  3963 */
                this.lastRecoveryTime = 0L;
                /*  3964 */
            } else if (bloodEffect.getSourceid() == 35111003) {
                /*  3965 */
                prepareRecovery();
                /*  3966 */
                if (this.stats.getMp() < bloodEffect.getU()) {
                    /*  3967 */
                    cancelEffectFromBuffStat(MapleBuffStat.骑兽技能);
                    /*  3968 */
                    cancelEffectFromBuffStat(MapleBuffStat.金属机甲);
                    /*       */
                } else {
                    /*  3970 */
                    addMP(-bloodEffect.getU());
                    /*       */
                }
                /*       */
            }
            /*       */
        } else {
            /*  3974 */
            prepareRecovery();
            /*  3975 */
            if (this.stats.getHp() >= this.stats.getCurrentMaxHp()) {
                /*  3976 */
                cancelEffectFromBuffStat(MapleBuffStat.恢复效果);
                /*       */
            } else {
                /*  3978 */
                healHP(bloodEffect.getX());
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean canRecover(long now) {
        /*  3984 */
        return (this.lastRecoveryTime > 0L && this.lastRecoveryTime + 5000L < now);
        /*       */
    }

    /*       */
    /*       */
    private void prepareRecovery() {
        /*  3988 */
        this.lastRecoveryTime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean canRepeatEffect(long now) {
        /*  3996 */
        return (this.lastRepeatEffectTime > 0L && this.lastRepeatEffectTime + 10000L < now);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void doRepeatEffect() {
        /*  4003 */
        List<MapleBuffStat> checkStat = new ArrayList<>();
        /*  4004 */
        checkStat.add(MapleBuffStat.寒冰灵气);
        /*  4005 */
        checkStat.add(MapleBuffStat.战法灵气);
        /*  4006 */
        boolean find = false;
        /*  4007 */
        for (MapleBuffStat stat : checkStat) {
            /*  4008 */
            MapleBuffStatValueHolder mbsvh = getBuffStatValueHolder(stat);
            /*  4009 */
            if (mbsvh != null) {
                /*  4010 */
                if (mbsvh.fromChrId == getId()) {
                    /*  4011 */
                    mbsvh.effect.applyBuffEffect(this, this, true, 180000, true, 0);
                    /*       */
                } else {
                    /*  4013 */
                    MapleCharacter from = this.map.getCharacterById(mbsvh.fromChrId);
                    /*  4014 */
                    if (from != null && from.getParty() != null && getParty() != null && from.getParty().getPartyId() == getParty().getPartyId()) {
                        /*  4015 */
                        mbsvh.effect.applyBuffEffect(from, this, false, 180000, true, 0);
                        /*       */
                    } else {
                        /*  4017 */
                        cancelEffect(mbsvh.effect, false, -1L);
                        /*       */
                    }
                    /*       */
                }
                /*  4020 */
                find = true;
                /*       */
            }
            /*       */
        }
        /*  4023 */
        if (!find) {
            /*  4024 */
            this.lastRepeatEffectTime = 0L;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void doRecoveryEM() {
        /*  4032 */
        MapleStatEffect bloodEffect = getStatForBuff(MapleBuffStat.恶魔恢复);
        /*  4033 */
        if (bloodEffect == null) {
            /*  4034 */
            this.lastRecoveryTimeEM = 0L;
            /*       */
            return;
            /*       */
        }
        /*  4037 */
        prepareRecoveryEM();
        /*  4038 */
        if (this.stats.getHp() < this.stats.getCurrentMaxHp()) {
            /*  4039 */
            healHP(bloodEffect.getX() * this.stats.getCurrentMaxHp() / 100);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean canRecoverEM(long now) {
        /*  4044 */
        MapleStatEffect effect = getStatForBuff(MapleBuffStat.恶魔恢复);
        /*  4045 */
        if (effect == null) {
            /*  4046 */
            this.lastRecoveryTimeEM = 0L;
            /*  4047 */
            return false;
            /*       */
        }
        /*  4049 */
        int time = effect.getY();
        /*  4050 */
        if (time < 4000) {
            /*  4051 */
            time = 4000;
            /*       */
        }
        /*  4053 */
        return (this.lastRecoveryTimeEM > 0L && this.lastRecoveryTimeEM + time < now);
        /*       */
    }

    /*       */
    /*       */
    private void prepareRecoveryEM() {
        /*  4057 */
        this.lastRecoveryTimeEM = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getPowerCountByJob() {
        /*  4064 */
        switch (getJob()) {
            /*       */
            case 3610:
                /*  4066 */
                return 10;
            /*       */
            case 3611:
                /*  4068 */
                return 15;
            /*       */
            case 3612:
                /*  4070 */
                return 20;
            /*       */
        }
        /*  4072 */
        return 5;
        /*       */
    }

    /*       */
    /*       */
    public void addPowerCount(int delta) {
        /*  4076 */
        Skill skill = SkillFactory.getSkill(30020232);
        /*  4077 */
        int skilllevel = getTotalSkillLevel(skill);
        /*  4078 */
        if (!JobConstants.is尖兵(getJob()) || skill == null || skilllevel <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  4081 */
        if (setPowerCount(this.specialStats.getPowerCount() + delta)) {
            /*  4082 */
            this.stats.recalcLocalStats(this);
            /*  4083 */
            this.client.announce(BuffPacket.updatePowerCount(30020232, this.specialStats.getPowerCount()));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean setPowerCount(int count) {
        /*  4088 */
        int oldPower = this.specialStats.getPowerCount();
        /*  4089 */
        int tempPower = count;
        /*  4090 */
        if (tempPower < 0) {
            /*  4091 */
            tempPower = 0;
            /*       */
        }
        /*  4093 */
        if (tempPower > getPowerCountByJob()) {
            /*  4094 */
            tempPower = getPowerCountByJob();
            /*       */
        }
        /*  4096 */
        this.specialStats.setPowerCount(tempPower);
        /*  4097 */
        return (this.specialStats.getPowerCount() != oldPower);
        /*       */
    }

    /*       */
    /*       */
    public void startPower() {
        /*  4101 */
        this.client.announce(BuffPacket.startPower());
        /*       */
    }

    /*       */
    /*       */
    public void doRecoveryPower() {
        /*  4105 */
        if (!JobConstants.is尖兵(getJob())) {
            /*       */
            return;
            /*       */
        }
        /*  4108 */
        this.specialStats.prepareRecoveryPowerTime();
        /*  4109 */
        addPowerCount(1);
        /*       */
    }

    /*       */
    /*       */
    public boolean canRecoverPower(long now) {
        /*  4113 */
        Skill skill = SkillFactory.getSkill(30020232);
        /*  4114 */
        int skilllevel = getTotalSkillLevel(skill);
        /*  4115 */
        return (JobConstants.is尖兵(getJob()) && skill != null && skilllevel > 0 && this.specialStats.getLastRecoveryPowerTime() > 0L && this.specialStats.getLastRecoveryPowerTime() + 4000L < now);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getEnergyCount() {
        /*  4122 */
        if (getBuffedValue(MapleBuffStat.能量获得) == null) {
            /*  4123 */
            return 0;
            /*       */
        }
        /*  4125 */
        return getBuffedValue(MapleBuffStat.能量获得).intValue();
        /*       */
    }

    /*       */
    /*       */
    public void setEnergyCount(int count) {
        /*  4129 */
        Skill echskill_2 = SkillFactory.getSkill(5100015);
        /*  4130 */
        if (getSkillLevel(echskill_2) <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  4133 */
        MapleStatEffect effect = echskill_2.getEffect(getTotalSkillLevel(echskill_2));
        /*  4134 */
        if (count > 0 && !this.specialStats.isEnergyFull()) {
            /*       */
            /*  4136 */
            if (getBuffedValue(MapleBuffStat.能量获得) == null) {
                /*  4137 */
                effect.applyEnergyBuff(this, count);
                /*       */
            }
            /*       */
            /*       */
            /*  4141 */
            int energy = getBuffedIntValue(MapleBuffStat.能量获得);
            /*  4142 */
            if (energy < 10000) {
                /*  4143 */
                energy += count;
                /*  4144 */
                if (energy >= 10000) {
                    /*  4145 */
                    energy = 10000;
                    /*  4146 */
                    this.specialStats.changeEnergyfull(true);
                    /*       */
                }
                /*  4148 */
                setBuffedValue(MapleBuffStat.能量获得, energy);
                /*       */
                /*  4150 */
                this.client.announce(EffectPacket.showOwnBuffEffect(effect.getSourceid(), EffectOpcode.UserEffect_SkillAffected.getValue(), getLevel(), effect.getLevel()));
                /*  4151 */
                this.client.announce(BuffPacket.giveEnergyCharge(energy, effect.getSourceid(), this.specialStats.isEnergyFull(), false));
                /*       */
                /*  4153 */
                this.map.broadcastMessage(this, EffectPacket.showBuffeffect(this, effect.getSourceid(), 3, getLevel(), effect.getLevel()), false);
                /*  4154 */
                this.map.broadcastMessage(this, BuffPacket.showEnergyCharge(this.id, energy, effect.getSourceid(), this.specialStats.isEnergyFull(), false), false);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleEnergyCharge(boolean energyfull) {
        /*  4164 */
        handleEnergyCharge(energyfull, false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleEnergyCharge(boolean energyfull, boolean energyexcite) {
        /*       */
        MapleStatEffect effect;
        /*  4222 */
        Skill echskill_2 = SkillFactory.getSkill(5100015);
        /*  4223 */
        Skill echskill_3 = SkillFactory.getSkill(5110014);
        /*  4224 */
        Skill echskill_4 = SkillFactory.getSkill(5120018);
        /*       */
        /*  4226 */
        if (getSkillLevel(echskill_4) > 0) {
            /*  4227 */
            effect = echskill_4.getEffect(getTotalSkillLevel(echskill_4));
            /*  4228 */
        } else if (getSkillLevel(echskill_3) > 0) {
            /*  4229 */
            effect = echskill_3.getEffect(getTotalSkillLevel(echskill_3));
            /*  4230 */
        } else if (getSkillLevel(echskill_2) > 0) {
            /*  4231 */
            effect = echskill_2.getEffect(getTotalSkillLevel(echskill_2));
            /*       */
        } else {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  4236 */
        int maxenergy = effect.getZ();
        /*  4237 */
        if (!this.specialStats.isEnergyFull()) {
            /*       */
            /*       */
            /*  4240 */
            if (energyfull) {
                /*  4241 */
                if (getBuffedValue(MapleBuffStat.能量获得) == null) {
                    /*       */
                    /*  4243 */
                    effect.applyEnergyBuff(this, 0);
                    /*       */
                    /*       */
                    return;
                    /*       */
                }
                /*       */
            } else {
                /*  4248 */
                effect.applyEnergyBuff(this, maxenergy);
                /*  4249 */
                this.specialStats.changeEnergyfull(true);
                /*       */
                /*       */
                return;
                /*       */
            }
            /*  4253 */
            if (!energyexcite) {
                /*       */
                /*  4255 */
                int energy = getBuffedIntValue(MapleBuffStat.能量获得);
                /*  4256 */
                if (energy < maxenergy) {
                    /*       */
                    /*  4258 */
                    energy += effect.getX();
                    /*  4259 */
                    if (energy >= maxenergy) {
                        /*  4260 */
                        energy = maxenergy;
                        /*  4261 */
                        this.specialStats.changeEnergyfull(true);
                        /*       */
                    }
                    /*       */
                    /*  4264 */
                    setBuffedValue(MapleBuffStat.能量获得, energy);
                    /*       */
                    /*  4266 */
                    this.client.getSession().write(EffectPacket.showEnergyCharge(effect.getSourceid(), getLevel(), effect.getLevel()));
                    /*  4267 */
                    this.client.getSession().write(BuffPacket.giveEnergyCharge(energy, effect.getSourceid(), this.specialStats.isEnergyFull(), false));
                    /*       */
                    /*  4269 */
                    this.map.broadcastMessage(this, EffectPacket.showEnergyCharge(this, effect.getSourceid(), getLevel(), effect.getLevel()), false);
                    /*  4270 */
                    this.map.broadcastMessage(this, BuffPacket.showEnergyCharge(this.id, energy, effect.getSourceid(), this.specialStats.isEnergyFull(), false), false);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleEnergyConsume(int mobCount, int skillId) {
        /*  4281 */
        MapleStatEffect echeffect = getStatForBuff(MapleBuffStat.能量获得);
        /*       */
        /*  4283 */
        if (skillId == 0 || (!this.specialStats.isEnergyFull() && skillId != 400051015) || echeffect == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  4287 */
        Skill skill = SkillFactory.getSkill(skillId);
        /*  4288 */
        int skillLevel = getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(skillId));
        /*  4289 */
        MapleStatEffect effect = skill.getEffect(skillLevel);
        /*       */
        /*       */
        /*  4292 */
        int energyconsume = (skillId == 400051015) ? effect.getX() : effect.getForceCon();
        /*       */
        /*  4294 */
        if (effect == null || energyconsume <= 0) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /*  4301 */
        int energy = getBuffedIntValue(MapleBuffStat.能量获得);
        /*  4302 */
        energy -= energyconsume;
        /*  4303 */
        if (energy <= 0) {
            /*  4304 */
            energy = 0;
            /*       */
            /*  4306 */
            if (getBuffedValue(MapleBuffStat.黑暗变形) != null) {
                /*  4307 */
                cancelEffectFromBuffStat(MapleBuffStat.黑暗变形);
                /*       */
            }
            /*  4309 */
            this.specialStats.changeEnergyfull(false);
            /*       */
        }
        /*       */
        /*  4312 */
        setBuffedValue(MapleBuffStat.能量获得, energy);
        /*  4313 */
        this.client.announce(BuffPacket.giveEnergyCharge(energy, echeffect.getSourceid(), this.specialStats.isEnergyFull(), (skillId != 400051015)));
        /*  4314 */
        this.map.broadcastMessage(this, BuffPacket.showEnergyCharge(this.id, energy, echeffect.getSourceid(), this.specialStats.isEnergyFull(), (skillId != 400051015)), false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle钢铁之躯() {
        /*  4322 */
        if (JobConstants.is英雄(this.job) || JobConstants.is黑骑士(this.job) || JobConstants.is圣骑士(this.job)) {
            /*  4323 */
            Skill skill = SkillFactory.getSkill(400011066);
            /*  4324 */
            if (getTotalSkillLevel(skill.getId()) > 0) {
                /*  4325 */
                MapleStatEffect effect = skill.getEffect(getTotalSkillLevel(400011066));
                /*  4326 */
                if (isAlive() && effect != null) {
                    /*       */
                    /*  4328 */
                    int maxcount = effect.getY();
                    /*       */
                    /*  4330 */
                    int count = Math.min(getSpecialStat().getManOfSteel(), maxcount);
                    /*  4331 */
                    if (count < maxcount) {
                        /*  4332 */
                        count++;
                        /*  4333 */
                        if (isShowPacket()) {
                            /*  4334 */
                            dropSpouseMessage(10, "当前钢铁之躯叠加: " + count + "次");
                            /*       */
                        }
                        /*  4336 */
                        effect.applyTo(this, true);
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean canPartyPassiveBuff(long now) {
        /*  4348 */
        if (getJob() != 11212 || !hasBuffSkill(110001504)) {
            /*  4349 */
            return false;
            /*       */
        }
        /*  4351 */
        if (this.checkPartyPassiveTime <= 0L) {
            /*  4352 */
            this.checkPartyPassiveTime = System.currentTimeMillis();
            /*       */
        }
        /*  4354 */
        return (this.checkPartyPassiveTime > 0L && this.checkPartyPassiveTime + 8000L < now);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void doPartyPassiveBuff() {
        /*  4361 */
        if (getJob() != 11212) {
            /*       */
            return;
            /*       */
        }
        /*  4364 */
        int[] skilllist = {112120016, 112120017, 112120018, 112120021, 112120022, 112120023};
        /*       */
        /*       */
        /*  4367 */
        for (int i : skilllist) {
            /*  4368 */
            Skill skill = SkillFactory.getSkill(i);
            /*  4369 */
            if (skill != null && getTotalSkillLevel(skill) > 0) {
                /*  4370 */
                MapleStatEffect effect = skill.getEffect(getTotalSkillLevel(skill));
                /*  4371 */
                if (effect != null) {
                    /*  4372 */
                    effect.applyTo(this);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*  4376 */
        this.checkPartyPassiveTime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean canRecoverCrit(long now) {
        /*  4383 */
        boolean is侠盗 = (getJob() == 420 || getJob() == 421 || getJob() == 422);
        /*  4384 */
        if (!is侠盗) {
            /*  4385 */
            this.lastCritStorageTime = 0L;
            /*  4386 */
            return false;
            /*       */
        }
        /*  4388 */
        if (this.lastCritStorageTime <= 0L) {
            /*  4389 */
            this.lastCritStorageTime = System.currentTimeMillis();
            /*       */
        }
        /*  4391 */
        return (this.lastCritStorageTime > 0L && this.lastCritStorageTime + 5000L < now);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleCritStorage() {
        /*       */
        MapleStatEffect skilleffect;
        /*  4399 */
        if (getJob() != 420 && getJob() != 421 && getJob() != 422) {
            /*  4400 */
            this.lastCritStorageTime = 0L;
            /*       */
            /*       */
            return;
            /*       */
        }
        /*  4404 */
        this.lastCritStorageTime = System.currentTimeMillis();
        /*       */
        /*  4406 */
        Skill critskill_2 = SkillFactory.getSkill(4200013);
        /*  4407 */
        Skill critskill_4 = SkillFactory.getSkill(4220015);
        /*       */
        /*  4409 */
        if (getSkillLevel(critskill_4) > 0) {
            /*  4410 */
            skilleffect = critskill_4.getEffect(getTotalSkillLevel(critskill_4));
            /*  4411 */
        } else if (getSkillLevel(critskill_2) > 0) {
            /*  4412 */
            skilleffect = critskill_2.getEffect(getTotalSkillLevel(critskill_2));
            /*       */
        } else {
            /*       */
            return;
            /*       */
        }
        /*  4416 */
        MapleBuffStat buffStat = MapleBuffStat.暴击蓄能;
        /*       */
        /*  4418 */
        MapleStatEffect effect = getStatForBuff(buffStat);
        /*  4419 */
        if (effect == null || getBuffedValue(buffStat) == null) {
            /*  4420 */
            skilleffect.applyTo(this);
            /*       */
            /*       */
            return;
            /*       */
        }
        /*  4424 */
        int crit = getBuffedIntValue(buffStat);
        /*  4425 */
        int newcrit = crit;
        /*       */
        /*  4427 */
        if (newcrit < 100) {
            /*  4428 */
            newcrit += skilleffect.getX();
            /*  4429 */
            if (newcrit > 100) {
                /*  4430 */
                newcrit = 100;
                /*       */
            }
            /*       */
        }
        /*       */
        /*  4434 */
        if (crit != newcrit) {
            /*  4435 */
            Map<MapleBuffStat, Integer> stat = Collections.singletonMap(buffStat, Integer.valueOf(newcrit));
            /*  4436 */
            setBuffedValue(buffStat, newcrit);
            /*  4437 */
            int duration = effect.getDuration();
            /*  4438 */
            duration += (int) (getBuffedStartTime(buffStat).longValue() - System.currentTimeMillis());
            /*  4439 */
            this.client.announce(BuffPacket.giveBuff(effect.getSourceid(), duration, stat, effect, this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getOrbCount() {
        /*  4452 */
        if (getBuffedValue(MapleBuffStat.斗气集中) == null) {
            /*  4453 */
            return 0;
            /*       */
        }
        /*  4455 */
        return getBuffedValue(MapleBuffStat.斗气集中).intValue();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleOrbgain(boolean passive) {
        /*       */
        MapleStatEffect effect;
        /*  4463 */
        if (getBuffedValue(MapleBuffStat.斗气集中) == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  4467 */
        int orbcount = getBuffedValue(MapleBuffStat.斗气集中).intValue();
        /*  4468 */
        Skill combo_2 = SkillFactory.getSkill(1101013);
        /*  4469 */
        Skill combo_3 = SkillFactory.getSkill(1110013);
        /*  4470 */
        Skill combo_4 = SkillFactory.getSkill(1120003);
        /*  4471 */
        if (passive && getTotalSkillLevel(combo_3) <= 0) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  4475 */
        if (getTotalSkillLevel(combo_3) > 0) {
            /*  4476 */
            effect = combo_3.getEffect(getTotalSkillLevel(combo_3));
            /*  4477 */
        } else if (getTotalSkillLevel(combo_2) > 0) {
            /*  4478 */
            effect = combo_2.getEffect(getTotalSkillLevel(combo_2));
            /*       */
        } else {
            /*       */
            return;
            /*       */
        }
        /*  4482 */
        int neworbcount = orbcount;
        /*  4483 */
        if (effect != null && orbcount < effect.getX() + 1) {
            /*  4484 */
            if (!passive && effect.makeChanceResult()) {
                /*  4485 */
                neworbcount++;
                /*       */
            }
            /*  4487 */
            if (passive && Randomizer.nextInt(100) < effect.getSubProp()) {
                /*  4488 */
                neworbcount++;
                /*       */
            }
            /*       */
        }
        /*       */
        /*  4492 */
        if (getTotalSkillLevel(combo_4) > 0 && !passive) {
            /*  4493 */
            effect = combo_4.getEffect(getTotalSkillLevel(combo_4));
            /*  4494 */
            if (effect != null && effect.makeChanceResult() && neworbcount < effect.getX() + 1) {
                /*  4495 */
                neworbcount++;
                /*       */
            }
            /*       */
        }
        /*  4498 */
        if (effect != null &&
                /*  4499 */       neworbcount != orbcount) {
            /*  4500 */
            Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.斗气集中, Integer.valueOf(neworbcount));
            /*  4501 */
            setBuffedValue(MapleBuffStat.斗气集中, neworbcount);
            /*  4502 */
            int duration = effect.getDuration();
            /*  4503 */
            duration += (int) (getBuffedStartTime(MapleBuffStat.斗气集中).longValue() - System.currentTimeMillis());
            /*  4504 */
            this.client.announce(BuffPacket.giveBuff(combo_2.getId(), duration, stat, effect, this));
            /*  4505 */
            this.map.broadcastMessage(this, BuffPacket.giveForeignBuff(this, stat, effect), false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleOrbconsume(int howmany) {
        /*  4514 */
        Skill combos = SkillFactory.getSkill(1101013);
        /*  4515 */
        if (getSkillLevel(combos) <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  4518 */
        MapleStatEffect effect = getStatForBuff(MapleBuffStat.斗气集中);
        /*  4519 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /*  4522 */
        Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.斗气集中, Integer.valueOf(Math.max(1, getBuffedValue(MapleBuffStat.斗气集中).intValue() - howmany)));
        /*  4523 */
        setBuffedValue(MapleBuffStat.斗气集中, Math.max(1, getBuffedValue(MapleBuffStat.斗气集中).intValue() - howmany));
        /*  4524 */
        int duration = effect.getDuration();
        /*  4525 */
        duration += (int) (getBuffedStartTime(MapleBuffStat.斗气集中).longValue() - System.currentTimeMillis());
        /*  4526 */
        this.client.announce(BuffPacket.giveBuff(combos.getId(), duration, stat, effect, this));
        /*  4527 */
        this.map.broadcastMessage(this, BuffPacket.giveForeignBuff(this, stat, effect), false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleArrowsCharge(int oid) {
        /*  4534 */
        Skill skill = SkillFactory.getSkill(3101009);
        /*  4535 */
        if (getSkillLevel(skill) <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  4538 */
        MapleStatEffect effect = skill.getEffect(getSkillLevel(skill));
        /*  4539 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /*  4542 */
        int oldMode = this.specialStats.getArrowsMode();
        /*  4543 */
        int arrows = getBuffedIntValue(MapleBuffStat.三彩箭矢);
        /*       */
        /*  4545 */
        if (getBuffedValue(MapleBuffStat.三彩箭矢) == null || oldMode == -1 || arrows == 0) {
            /*  4546 */
            effect.applyArrowsBuff(this, true);
            /*       */
            return;
            /*       */
        }
        /*  4549 */
        int newMode = oldMode;
        /*  4550 */
        if (oldMode == 0 && arrows / 10000 > 0) {
            /*  4551 */
            arrows -= 10000;
            /*  4552 */
            if (arrows / 10000 == 0 && arrows % 10000 / 100 > 0) {
                /*  4553 */
                newMode = 1;
                /*  4554 */
            } else if (arrows / 10000 == 0 && arrows % 100 > 0) {
                /*  4555 */
                newMode = 2;
                /*       */
            }
            /*  4557 */
        } else if (oldMode == 1 && arrows % 10000 / 100 > 0) {
            /*  4558 */
            arrows -= 100;
            /*  4559 */
            if (arrows % 10000 / 100 == 0 && arrows % 100 > 0) {
                /*  4560 */
                newMode = 2;
                /*  4561 */
            } else if (arrows % 10000 / 100 == 0 && arrows / 10000 > 0) {
                /*  4562 */
                newMode = 0;
                /*       */
            }
            /*  4564 */
        } else if (oldMode == 2 && arrows % 100 > 0) {
            /*  4565 */
            arrows--;
            /*  4566 */
            handle三彩箭矢(oid);
            /*  4567 */
            if (arrows % 100 == 0 && arrows / 10000 > 0) {
                /*  4568 */
                newMode = 0;
                /*  4569 */
            } else if (arrows % 100 == 0 && arrows % 10000 / 100 > 0) {
                /*  4570 */
                newMode = 1;
                /*       */
            }
            /*       */
        }
        /*  4573 */
        if (arrows <= 0) {
            /*  4574 */
            effect.applyArrowsBuff(this, true);
            /*  4575 */
        } else if (getBuffedValue(MapleBuffStat.进阶箭筒) == null) {
            /*  4576 */
            this.specialStats.setArrowsMode(newMode);
            /*  4577 */
            Map<MapleBuffStat, Integer> localstatups = Collections.singletonMap(MapleBuffStat.三彩箭矢, Integer.valueOf(arrows));
            /*  4578 */
            setBuffedValue(MapleBuffStat.三彩箭矢, arrows);
            /*  4579 */
            this.client.announce(BuffPacket.giveBuff(effect.getSourceid(), 0, localstatups, effect, this));
            /*  4580 */
            if (newMode != oldMode) {
                /*  4581 */
                int newArrows = 10;
                /*  4582 */
                if (newMode == 0) {
                    /*  4583 */
                    newArrows = arrows / 10000;
                    /*  4584 */
                } else if (newMode == 1) {
                    /*  4585 */
                    newArrows = arrows % 10000 / 100;
                    /*  4586 */
                } else if (newMode == 2) {
                    /*  4587 */
                    newArrows = arrows % 100;
                    /*       */
                }
                /*  4589 */
                this.client.announce(EffectPacket.showArrowsEffect(effect.getSourceid(), this.specialStats.getArrowsMode(), newArrows));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getDarkLight() {
        /*  4595 */
        return this.specialStats.getDarkLight();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleLuminous(int skillId) {
        /*       */
        int gauge;
        /*  4669 */
        if (skillId == 27121054) {
            /*       */
            /*  4671 */
            int[] skills = {27111303, 27121303};
            /*  4672 */
            for (int i = 0; i < skills.length; i++) {
                /*  4673 */
                removeCooldown(skills[i], true);
                /*       */
            }
            /*       */
            /*  4676 */
            this.specialStats.setDarkLight(0);
            /*       */
            /*  4678 */
            this.client.announce(BuffPacket.updateLuminousGauge(0, (byte) 1));
            /*       */
            /*  4680 */
            SkillFactory.getSkill(20040219).getEffect(1).applyTo(this);
            /*       */
            return;
            /*       */
        }
        /*  4683 */
        int skillMode = SkillConstants.getLuminousSkillMode(skillId);
        /*       */
        /*  4685 */
        if (skillMode < 0 || skillMode == 20040219 || getSkillLevel(skillMode) <= 0) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*       */
        /*  4690 */
        Integer buffvalue = getBuffedValue(MapleBuffStat.光暗转换);
        /*       */
        /*  4692 */
        if (buffvalue != null && buffvalue.intValue() == 2) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  4698 */
        byte gaugetype = (byte) ((skillMode == 20040216) ? 1 : 2);
        /*       */
        /*  4700 */
        int balanceid = -1;
        /*       */
        /*  4702 */
        if (!hasBuffSkill(20040216) && !hasBuffSkill(20040217)) {
            /*  4703 */
            int newskillid = (gaugetype == 1) ? 20040217 : 20040216;
            /*  4704 */
            SkillFactory.getSkill(newskillid).getEffect(1).applyTo(this);
            /*  4705 */
            gauge = (skillMode == 20040216) ? 1 : 9999;
            /*       */
        } else {
            /*  4707 */
            boolean isLightMode = (getBuffSource(MapleBuffStat.光暗转换) == 20040216);
            /*  4708 */
            boolean isApply = false;
            /*  4709 */
            gauge = this.specialStats.getDarkLight();
            /*  4710 */
            MapleStatEffect effect = SkillFactory.getSkill(skillId).getEffect(getTotalSkillLevel(skillId));
            /*  4711 */
            int gauge_val = (int) (effect.getGauge() * (getStat().getGauge_x() / 100.0D + 1.0D));
            /*  4712 */
            if (gaugetype == 1 && isLightMode) {
                /*  4713 */
                gauge = Math.max(1, gauge - gauge_val);
                /*  4714 */
                isApply = true;
                /*  4715 */
            } else if (gaugetype == 2 && !isLightMode) {
                /*  4716 */
                gauge = Math.min(9999, gauge + gauge_val);
                /*  4717 */
                isApply = true;
                /*       */
            }
            /*       */
            /*       */
            /*  4721 */
            if (isLightMode && skillMode != 20040217) {
                /*       */
                /*  4723 */
                int hpheal = this.stats.getMaxHp() / 100;
                /*  4724 */
                addHP(hpheal);
                /*  4725 */
                if (isShowPacket()) {
                    /*  4726 */
                    dropDebugMessage(1, "[太阳火焰] 恢复1%Hp:" + hpheal);
                    /*       */
                }
                /*       */
            }
            /*       */
            /*  4730 */
            if (gauge == 9999) {
                /*  4731 */
                balanceid = 20040220;
                /*  4732 */
            } else if (gauge == 1) {
                /*  4733 */
                balanceid = 20040219;
                /*       */
            }
            /*       */
            /*  4736 */
            if (isApply && balanceid > 0) {
                /*  4737 */
                cancelBuffStats(new MapleBuffStat[]{MapleBuffStat.光暗转换});
                /*  4738 */
                int[] skills = {27111303, 27121303};
                /*  4739 */
                for (int i = 0; i < skills.length; i++) {
                    /*  4740 */
                    removeCooldown(skills[i], true);
                    /*       */
                }
                /*  4742 */
                SkillFactory.getSkill(balanceid).getEffect(1).applyTo(this);
                /*       */
            }
            /*       */
        }
        /*       */
        /*  4746 */
        this.specialStats.setDarkLight(gauge);
        /*  4747 */
        this.client.announce(BuffPacket.updateLuminousGauge(gauge, gaugetype));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleBlackBless() {
        /*  4755 */
        if (this.lastBlessOfDarknessTime == 0L) {
            /*  4756 */
            this.lastBlessOfDarknessTime = System.currentTimeMillis();
            /*       */
        }
        /*  4758 */
        Skill skill = SkillFactory.getSkill(27100003);
        /*  4759 */
        int skilllevel = getTotalSkillLevel(skill);
        /*  4760 */
        if (skilllevel <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  4763 */
        MapleStatEffect effect = skill.getEffect(skilllevel);
        /*  4764 */
        if (getStatForBuff(MapleBuffStat.黑暗祝福) == null) {
            /*  4765 */
            effect.applyTo(this);
            /*       */
            return;
            /*       */
        }
        /*  4768 */
        if (this.lastBlessOfDarknessTime + effect.getDuration() < System.currentTimeMillis()) {
            /*  4769 */
            int count = getBuffedValue(MapleBuffStat.黑暗祝福).intValue();
            /*  4770 */
            if (count < 3) {
                /*  4771 */
                count++;
                /*       */
            }
            /*  4773 */
            Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.黑暗祝福, Integer.valueOf(count));
            /*  4774 */
            setBuffedValue(MapleBuffStat.黑暗祝福, count);
            /*  4775 */
            this.client.announce(EffectPacket.showBlessOfDarkness(skill.getId()));
            /*  4776 */
            this.client.announce(BuffPacket.giveBuff(skill.getId(), 0, stat, effect, this));
            /*  4777 */
            this.lastBlessOfDarknessTime = System.currentTimeMillis();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handleBlackBlessLost(int howmany) {
        /*  4782 */
        Skill skill = SkillFactory.getSkill(27100003);
        /*  4783 */
        if (getSkillLevel(skill) <= 0) {
            /*  4784 */
            cancelEffectFromBuffStat(MapleBuffStat.黑暗祝福);
            /*       */
            return;
            /*       */
        }
        /*  4787 */
        MapleStatEffect effect = getStatForBuff(MapleBuffStat.黑暗祝福);
        /*  4788 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /*  4791 */
        this.lastBlessOfDarknessTime = System.currentTimeMillis();
        /*  4792 */
        int count = getBuffedValue(MapleBuffStat.黑暗祝福).intValue();
        /*  4793 */
        count -= howmany;
        /*  4794 */
        if (count <= 0) {
            /*  4795 */
            cancelEffectFromBuffStat(MapleBuffStat.黑暗祝福);
            /*       */
        } else {
            /*  4797 */
            Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.黑暗祝福, Integer.valueOf(count));
            /*  4798 */
            setBuffedValue(MapleBuffStat.黑暗祝福, count);
            /*  4799 */
            this.client.announce(EffectPacket.showBlessOfDarkness(skill.getId()));
            /*  4800 */
            this.client.announce(BuffPacket.giveBuff(skill.getId(), 0, stat, effect, this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleDarkCrescendo() {
        /*  4808 */
        MapleStatEffect dkeffect = getStatForBuff(MapleBuffStat.黑暗高潮);
        /*  4809 */
        if (dkeffect != null && dkeffect.getSourceid() == 27121005) {
            /*  4810 */
            int orbcount = getBuffedValue(MapleBuffStat.黑暗高潮).intValue();
            /*  4811 */
            Skill skill = SkillFactory.getSkill(27121005);
            /*  4812 */
            if (getSkillLevel(skill) > 0) {
                /*  4813 */
                MapleStatEffect effect = skill.getEffect(getTotalSkillLevel(skill));
                /*  4814 */
                if (orbcount < effect.getX() && effect.makeChanceResult()) {
                    /*  4815 */
                    int neworbcount = orbcount + 1;
                    /*  4816 */
                    Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.黑暗高潮, Integer.valueOf(neworbcount));
                    /*  4817 */
                    setBuffedValue(MapleBuffStat.黑暗高潮, neworbcount);
                    /*  4818 */
                    int duration = effect.getDuration();
                    /*  4819 */
                    duration += (int) (getBuffedStartTime(MapleBuffStat.黑暗高潮).longValue() - System.currentTimeMillis());
                    /*  4820 */
                    this.client.announce(BuffPacket.giveBuff(skill.getId(), duration, stat, effect, this));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean canMorphLost(long now) {
        /*  4830 */
        return (getJob() >= 6100 && getJob() <= 6112 && this.specialStats.getLastMorphLostTime() > 0L && this.specialStats.getMorphCount() > 0 && this.specialStats.getLastMorphLostTime() + 20000L < now);
        /*       */
    }

    /*       */
    /*       */
    public void morphLostTask() {
        /*  4834 */
        if (getJob() >= 6100 && getJob() <= 6112) {
            /*  4835 */
            if (this.specialStats.getMorphCount() > 0) {
                /*  4836 */
                this.specialStats.gainMorphCount(-1);
                /*  4837 */
                this.client.announce(BuffPacket.give狂龙变形值(this.specialStats.getMorphCount()));
                /*       */
            }
            /*  4839 */
            this.specialStats.prepareMorphLostTime();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getMorphCount() {
        /*  4844 */
        return this.specialStats.getMorphCount();
        /*       */
    }

    /*       */
    /*       */
    public void setMorphCount(int amount) {
        /*  4848 */
        this.specialStats.setMorphCount(amount);
        /*  4849 */
        if (this.specialStats.getMorphCount() <= 0) {
            /*  4850 */
            this.specialStats.setMorphCount(0);
            /*  4851 */
            this.client.announce(BuffPacket.cancelBuff(MapleBuffStat.变形值));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handleMorphCharge(int targets) {
        /*  4856 */
        Skill mchskill = SkillFactory.getSkill(60000219);
        /*  4857 */
        int skilllevel = getTotalSkillLevel(mchskill);
        /*  4858 */
        if (skilllevel > 0) {
            /*  4859 */
            MapleStatEffect mcheff = mchskill.getEffect(skilllevel);
            /*  4860 */
            if (targets > 0 && mcheff != null) {
                /*  4861 */
                this.specialStats.prepareMorphLostTime();
                /*  4862 */
                int maxCount = (getJob() == 6100) ? mcheff.getS() : ((getJob() == 6110) ? mcheff.getU() : mcheff.getV());
                /*  4863 */
                if (this.specialStats.getMorphCount() < maxCount) {
                    /*  4864 */
                    this.specialStats.gainMorphCount(targets);
                    /*  4865 */
                    if (this.specialStats.getMorphCount() >= maxCount) {
                        /*  4866 */
                        this.specialStats.setMorphCount(maxCount);
                        /*       */
                    }
                    /*  4868 */
                    this.client.announce(BuffPacket.give狂龙变形值(this.specialStats.getMorphCount()));
                    /*  4869 */
                    if (isAdmin()) {
                        /*  4870 */
                        this.map.broadcastMessage(this, BuffPacket.show狂龙变形值(getId(), this.specialStats.getMorphCount()), false);
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handleDeathPact(int moboid, boolean attackBoss) {
        /*  4878 */
        if (getBuffStatValueHolder(MapleBuffStat.死亡契约) == null) {
            /*       */
            return;
            /*       */
        }
        /*  4881 */
        int[] skills_ = {32120019, 32110017, 32100010, 32001014};
        /*  4882 */
        MapleStatEffect effect = null;
        /*  4883 */
        for (int skillid_ : skills_) {
            /*  4884 */
            if (getSkillLevel(skillid_) > 0) {
                /*  4885 */
                effect = SkillFactory.getSkill(skillid_).getEffect(1);
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*  4889 */
        MapleMonster mob = getMap().getMonsterByOid(moboid);
        /*  4890 */
        if (effect == null || mob == null) {
            /*       */
            return;
            /*       */
        }
        /*  4893 */
        MapleSummon summon = getSummonBySkill(effect.getSourceid());
        /*  4894 */
        if (summon == null) {
            /*       */
            return;
            /*       */
        }
        /*  4897 */
        int maxCount = effect.getX() - (hasBuffSkill(32121056) ? 3 : 0);
        /*  4898 */
        int currentCount = getSpecialStat().getDeathPactCount();
        /*  4899 */
        if (currentCount < maxCount) {
            /*  4900 */
            getSpecialStat().setDeathPactCount(Math.min(currentCount + ((attackBoss && mob.isBoss()) ? 2 : 1), maxCount));
            /*       */
        }
        /*  4902 */
        else if (summon.checkLastAttackTime()) {
            /*  4903 */
            getSpecialStat().setDeathPactCount(0);
            /*  4904 */
            getMap().broadcastMessage(SummonPacket.summonSkillLink(this.id, summon.getObjectId(), 0), getTruePosition());
            /*       */
        }
        /*       */
        /*  4907 */
        Map<MapleBuffStat, Integer> localstatups = Collections.singletonMap(MapleBuffStat.死亡契约, Integer.valueOf(getSpecialStat().getDeathPactCount()));
        /*  4908 */
        setBuffedValue(MapleBuffStat.死亡契约, getSpecialStat().getDeathPactCount());
        /*  4909 */
        this.client.announce(BuffPacket.giveBuff(effect.getSourceid(), 0, localstatups, effect, this));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void handlerKSTelekinesis(int oid) {
        /*  4914 */
        Skill skill = SkillFactory.getSkill(142110011);
        /*  4915 */
        int skilllevel = getSkillLevel(142110011);
        /*  4916 */
        if (skilllevel > 0) {
            /*  4917 */
            MapleStatEffect effect = skill.getEffect(skilllevel);
            /*  4918 */
            if (effect != null && Randomizer.nextInt(100) < effect.getProp()) {
                /*  4919 */
                this.specialStats.gainCardStack();
                /*  4920 */
                getMap().broadcastMessage(ForcePacket.心灵传动攻击效果(getId(), oid, 142110011, this.specialStats.getCardStack()), getTruePosition());
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void silentEnforceMaxHpMp() {
        /*  4926 */
        this.stats.setMp(this.stats.getMp(), this);
        /*  4927 */
        this.stats.setHp(this.stats.getHp(), true, this);
        /*       */
    }

    /*       */
    /*       */
    public void enforceMaxHpMp() {
        /*  4931 */
        List<Pair<MapleStat, Long>> statup = new ArrayList<>(2);
        /*  4932 */
        if (this.stats.getMp() > this.stats.getCurrentMaxMp(getJob())) {
            /*  4933 */
            this.stats.setMp(this.stats.getMp(), this);
            /*  4934 */
            statup.add(new Pair(MapleStat.MP, Long.valueOf(this.stats.getMp())));
            /*       */
        }
        /*  4936 */
        if (this.stats.getHp() > this.stats.getCurrentMaxHp()) {
            /*  4937 */
            this.stats.setHp(this.stats.getHp(), this);
            /*  4938 */
            statup.add(new Pair(MapleStat.HP, Long.valueOf(this.stats.getHp())));
            /*       */
        }
        /*  4940 */
        if (statup.size() > 0) {
            /*  4941 */
            this.client.announce(MaplePacketCreator.updatePlayerStats(statup, this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleMap getMap() {
        /*  4946 */
        return this.map;
        /*       */
    }

    /*       */
    /*       */
    public void setMap(int PmapId) {
        /*  4950 */
        this.mapid = PmapId;
        /*       */
    }

    /*       */
    /*       */
    public void setMap(MapleMap newmap) {
        /*  4954 */
        this.map = newmap;
        /*       */
    }

    /*       */
    /*       */
    public MonsterBook getMonsterBook() {
        /*  4958 */
        return this.monsterbook;
        /*       */
    }

    /*       */
    /*       */
    public int getMapId() {
        /*  4962 */
        if (this.map != null) {
            /*  4963 */
            return this.map.getId();
            /*       */
        }
        /*  4965 */
        return this.mapid;
        /*       */
    }

    /*       */
    /*       */
    public byte getInitialSpawnpoint() {
        /*  4969 */
        return this.initialSpawnPoint;
        /*       */
    }

    /*       */
    /*       */
    public int getId() {
        /*  4973 */
        return this.id;
        /*       */
    }

    /*       */
    /*       */
    public String getName() {
        /*  4977 */
        return this.name;
        /*       */
    }

    /*       */
    /*       */
    public void setName(String name) {
        /*  4981 */
        this.name = name;
        /*       */
    }

    /*       */
    /*       */
    public String getBlessOfFairyOrigin() {
        /*  4985 */
        return this.BlessOfFairy_Origin;
        /*       */
    }

    /*       */
    /*       */
    public String getBlessOfEmpressOrigin() {
        /*  4989 */
        return this.BlessOfEmpress_Origin;
        /*       */
    }

    /*       */
    /*       */
    public int getLevel() {
        /*  4993 */
        return this.level;
        /*       */
    }

    /*       */
    /*       */
    public void setLevel(short newLevel) {
        /*  4997 */
        if (newLevel <= 0) {
            /*  4998 */
            newLevel = 1;
            /*       */
        }
        /*  5000 */
        this.level = newLevel;
        /*       */
    }

    /*       */
    /*       */
    public int getFame() {
        /*  5004 */
        return this.fame;
        /*       */
    }

    /*       */
    /*       */
    public void setFame(int fame) {
        /*  5008 */
        this.fame = fame;
        /*       */
    }

    /*       */
    /*       */
    public int getFallCounter() {
        /*  5012 */
        return this.fallcounter;
        /*       */
    }

    /*       */
    /*       */
    public void setFallCounter(int fallcounter) {
        /*  5016 */
        this.fallcounter = fallcounter;
        /*       */
    }

    /*       */
    /*       */
    public int getCriticalGrowth() {
        /*  5020 */
        return this.criticalgrowth;
        /*       */
    }

    /*       */
    /*       */
    public void setCriticalGrowth(int critical) {
        /*  5024 */
        this.criticalgrowth = critical;
        /*       */
    }

    /*       */
    /*       */
    public MapleClient getClient() {
        /*  5028 */
        return this.client;
        /*       */
    }

    /*       */
    /*       */
    public void setClient(MapleClient client) {
        /*  5032 */
        this.client = client;
        /*       */
    }

    /*       */
    /*       */
    public long getExp() {
        /*  5036 */
        return this.exp.get();
        /*       */
    }

    /*       */
    /*       */
    public void setExp(long exp) {
        /*  5040 */
        this.exp.set(exp);
        /*       */
    }

    /*       */
    /*       */
    public short getRemainingAp() {
        /*  5044 */
        return this.remainingAp;
        /*       */
    }

    /*       */
    /*       */
    public void setRemainingAp(short remainingAp) {
        /*  5048 */
        this.remainingAp = remainingAp;
        /*       */
    }

    /*       */
    /*       */
    public int getRemainingSp() {
        /*  5052 */
        return this.remainingSp[JobConstants.getSkillBookByJob(this.job)];
        /*       */
    }

    /*       */
    /*       */
    public void setRemainingSp(int remainingSp) {
        /*  5056 */
        this.remainingSp[JobConstants.getSkillBookByJob(this.job)] = remainingSp;
        /*       */
    }

    /*       */
    /*       */
    public int getRemainingSp(int skillbook) {
        /*  5060 */
        return this.remainingSp[skillbook];
        /*       */
    }

    /*       */
    /*       */
    public int[] getRemainingSps() {
        /*  5064 */
        return this.remainingSp;
        /*       */
    }

    /*       */
    /*       */
    public int getRemainingSpSize() {
        /*  5068 */
        int ret = 0;
        /*  5069 */
        for (int aRemainingSp : this.remainingSp) {
            /*  5070 */
            if (aRemainingSp > 0) {
                /*  5071 */
                ret++;
                /*       */
            }
            /*       */
        }
        /*  5074 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public short getHpApUsed() {
        /*  5078 */
        return this.hpApUsed;
        /*       */
    }

    /*       */
    /*       */
    public void setHpApUsed(short hpApUsed) {
        /*  5082 */
        this.hpApUsed = hpApUsed;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean isHidden() {
        /*  5089 */
        return (getBuffSource(MapleBuffStat.隐身术) / 1000000 == 9);
        /*       */
    }

    /*       */
    /*       */
    public byte getSkinColor() {
        /*  5093 */
        return this.skinColor;
        /*       */
    }

    /*       */
    /*       */
    public void setSkinColor(byte skinColor) {
        /*  5097 */
        this.skinColor = skinColor;
        /*       */
    }

    /*       */
    /*       */
    public short getJob() {
        /*  5101 */
        return this.job;
        /*       */
    }

    /*       */
    /*       */
    public void setJob(int jobId) {
        /*  5105 */
        this.job = (short) jobId;
        /*       */
    }

    /*       */
    /*       */
    public void writeJobData(MaplePacketLittleEndianWriter mplew) {
        /*  5109 */
        boolean sub = (getJob() == 400 && getSubcategory() == 1);
        /*  5110 */
        mplew.writeShort(getJob());
        /*  5111 */
        mplew.writeShort(sub ? (short) getSubcategory() : 0);
        /*       */
    }

    /*       */
    /*       */
    public byte getAccountGender() {
        /*  5115 */
        return this.accountGender;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public byte getGender() {
        /*  5122 */
        return this.gender;
        /*       */
    }

    /*       */
    /*       */
    public void setGender(byte gender) {
        /*  5126 */
        this.gender = gender;
        /*       */
    }

    /*       */
    /*       */
    public int getReviveCount() {
        /*  5130 */
        return this.reviveCount;
        /*       */
    }

    /*       */
    /*       */
    public void setReviveCount(int reviveCount) {
        /*  5134 */
        this.reviveCount = reviveCount;
        /*       */
    }

    /*       */
    /*       */
    public void reduceReviveCount() {
        /*  5138 */
        this.reviveCount--;
        /*       */
    }

    /*       */
    /*       */
    public void restReviveCount() {
        /*  5142 */
        this.reviveCount = -1;
        /*       */
    }

    /*       */
    /*       */
    public void eventRevive() {
        /*  5146 */
        heal();
        /*  5147 */
        reduceReviveCount();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public byte getSecondGender() {
        /*  5155 */
        if (JobConstants.is神之子(this.job)) {
            /*  5156 */
            return 1;
            /*       */
        }
        /*  5158 */
        return this.gender;
        /*       */
    }

    /*       */
    /*       */
    public byte getZeroLook() {
        /*  5162 */
        if (!JobConstants.is神之子(this.job)) {
            /*  5163 */
            return -1;
            /*       */
        }
        /*  5165 */
        if (getKeyValue("Zero_Look") == null) {
            /*  5166 */
            setKeyValue("Zero_Look", "0");
            /*       */
        }
        /*  5168 */
        return Byte.parseByte(getKeyValue("Zero_Look"));
        /*       */
    }

    /*       */
    /*       */
    public void changeZeroLook() {
        /*  5172 */
        if (!JobConstants.is神之子(this.job)) {
            /*       */
            return;
            /*       */
        }
        /*  5175 */
        setKeyValue("Zero_Look", isZeroSecondLook() ? "0" : "1");
        /*  5176 */
        this.map.broadcastMessage(this, MaplePacketCreator.updateZeroLook(this), false);
        /*  5177 */
        this.stats.recalcLocalStats(this);
        /*       */
    }

    /*       */
    /*       */
    public boolean isZeroSecondLook() {
        /*  5181 */
        return (getZeroLook() == 1);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getHair() {
        /*  5188 */
        return this.hair;
        /*       */
    }

    /*       */
    /*       */
    public void setHair(int hair) {
        /*  5192 */
        this.hair = hair;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getSecondHair() {
        /*  5200 */
        if (JobConstants.is神之子(this.job)) {
            /*  5201 */
            if (getKeyValue("Second_Hair") == null) {
                /*  5202 */
                setKeyValue("Second_Hair", "37623");
                /*       */
            }
            /*  5204 */
            return Integer.parseInt(getKeyValue("Second_Hair"));
            /*  5205 */
        }
        if (JobConstants.is爆莉萌天使(this.job)) {
            /*  5206 */
            if (getKeyValue("Second_Hair") == null) {
                /*  5207 */
                setKeyValue("Second_Hair", "37141");
                /*       */
            }
            /*  5209 */
            return Integer.parseInt(getKeyValue("Second_Hair"));
            /*       */
        }
        /*  5211 */
        return this.hair;
        /*       */
    }

    /*       */
    /*       */
    public void setSecondHair(int hair) {
        /*  5215 */
        setKeyValue("Second_Hair", String.valueOf(hair));
        /*       */
    }

    /*       */
    /*       */
    public byte getSecondSkinColor() {
        /*  5219 */
        if (JobConstants.is爆莉萌天使(this.job)) {
            /*  5220 */
            if (getKeyValue("Second_Skin") == null) {
                /*  5221 */
                setKeyValue("Second_Skin", "0");
                /*       */
            }
            /*  5223 */
            return Byte.parseByte(getKeyValue("Second_Skin"));
            /*       */
        }
        /*  5225 */
        return this.skinColor;
        /*       */
    }

    /*       */
    /*       */
    public void setSecondSkinColor(byte b) {
        /*  5229 */
        setKeyValue("Second_Skin", String.valueOf(b));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getFace() {
        /*  5236 */
        return this.face;
        /*       */
    }

    /*       */
    /*       */
    public void setFace(int face) {
        /*  5240 */
        this.face = face;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getSecondFace() {
        /*  5248 */
        if (JobConstants.is神之子(this.job)) {
            /*  5249 */
            if (getKeyValue("Second_Face") == null) {
                /*  5250 */
                setKeyValue("Second_Face", "21290");
                /*       */
            }
            /*  5252 */
            return Integer.parseInt(getKeyValue("Second_Face"));
            /*  5253 */
        }
        if (JobConstants.is爆莉萌天使(this.job)) {
            /*  5254 */
            if (getKeyValue("Second_Face") == null) {
                /*  5255 */
                setKeyValue("Second_Face", "21173");
                /*       */
            }
            /*  5257 */
            return Integer.parseInt(getKeyValue("Second_Face"));
            /*       */
        }
        /*  5259 */
        return this.face;
        /*       */
    }

    /*       */
    /*       */
    public void setSecondFace(int face) {
        /*  5263 */
        setKeyValue("Second_Face", String.valueOf(face));
        /*       */
    }

    /*       */
    /*       */
    public boolean changeFace(int color) {
        /*  5267 */
        int f = 0;
        /*  5268 */
        if (this.face % 1000 < 100) {
            /*  5269 */
            f = this.face + color;
            /*  5270 */
        } else if (this.face % 1000 >= 100 && this.face % 1000 < 200) {
            /*  5271 */
            f = this.face - 100 + color;
            /*  5272 */
        } else if (this.face % 1000 >= 200 && this.face % 1000 < 300) {
            /*  5273 */
            f = this.face - 200 + color;
            /*  5274 */
        } else if (this.face % 1000 >= 300 && this.face % 1000 < 400) {
            /*  5275 */
            f = this.face - 300 + color;
            /*  5276 */
        } else if (this.face % 1000 >= 400 && this.face % 1000 < 500) {
            /*  5277 */
            f = this.face - 400 + color;
            /*  5278 */
        } else if (this.face % 1000 >= 500 && this.face % 1000 < 600) {
            /*  5279 */
            f = this.face - 500 + color;
            /*  5280 */
        } else if (this.face % 1000 >= 600 && this.face % 1000 < 700) {
            /*  5281 */
            f = this.face - 600 + color;
            /*  5282 */
        } else if (this.face % 1000 >= 700 && this.face % 1000 < 800) {
            /*  5283 */
            f = this.face - 700 + color;
            /*       */
        }
        /*  5285 */
        if (!MapleItemInformationProvider.getInstance().loadHairFace(f)) {
            /*  5286 */
            return false;
            /*       */
        }
        /*  5288 */
        this.face = f;
        /*  5289 */
        updateSingleStat(MapleStat.脸型, this.face);
        /*  5290 */
        equipChanged();
        /*  5291 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    public byte getHairBaseColor() {
        /*  5295 */
        return this.hairBaseColor;
        /*       */
    }

    /*       */
    /*       */
    public void setHairBaseColor(byte hairBaseColor) {
        /*  5299 */
        this.hairBaseColor = hairBaseColor;
        /*       */
    }

    /*       */
    /*       */
    public byte getHairProbColor() {
        /*  5303 */
        return this.hairProbColor;
        /*       */
    }

    /*       */
    /*       */
    public void setHairProbColor(byte hairProbColor) {
        /*  5307 */
        this.hairProbColor = hairProbColor;
        /*       */
    }

    /*       */
    /*       */
    public byte getHairMixedColor() {
        /*  5311 */
        return this.hairMixedColor;
        /*       */
    }

    /*       */
    /*       */
    public void setHairMixedColor(byte hairMixedColor) {
        /*  5315 */
        this.hairMixedColor = hairMixedColor;
        /*       */
    }

    /*       */
    /*       */
    public void handleMixHairColor(byte mixBaseHairColor, byte mixAddHairColor, byte mixHairBaseProb) {
        /*  5319 */
        this.hairBaseColor = mixBaseHairColor;
        /*  5320 */
        this.hairMixedColor = mixAddHairColor;
        /*  5321 */
        this.hairProbColor = mixHairBaseProb;
        /*  5322 */
        int hair = this.hair / 10 * 10 + mixBaseHairColor;
        /*  5323 */
        updateHair(hair);
        /*       */
    }

    /*       */
    /*       */
    public Point getOldPosition() {
        /*  5327 */
        return this.old;
        /*       */
    }

    /*       */
    /*       */
    public void setOldPosition(Point x) {
        /*  5331 */
        this.old = x;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getLastAttackSkillId() {
        /*  5338 */
        return this.lastAttackSkillId;
        /*       */
    }

    /*       */
    /*       */
    public void setLastAttackSkillId(int skillId) {
        /*  5342 */
        this.lastAttackSkillId = skillId;
        /*       */
    }

    /*       */
    /*       */
    public void setRemainingSp(int remainingSp, int skillbook) {
        /*  5346 */
        this.remainingSp[skillbook] = remainingSp;
        /*       */
    }

    /*       */
    /*       */
    public boolean isInvincible() {
        /*  5350 */
        return this.invincible;
        /*       */
    }

    /*       */
    /*       */
    public void setInvincible(boolean invinc) {
        /*  5354 */
        this.invincible = invinc;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public CheatTracker getCheatTracker() {
        /*  5361 */
        return this.anticheat;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleLieDetector getAntiMacro() {
        /*  5368 */
        return this.antiMacro;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public BuddyList getBuddylist() {
        /*  5375 */
        return this.buddylist;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addFame(int famechange) {
        /*  5382 */
        this.fame += famechange;
        /*  5383 */
        getTrait(MapleTraitType.charm).addLocalExp(famechange);
        /*  5384 */
        if (this.fame >= 50) {
            /*  5385 */
            finishAchievement(7);
            /*       */
        }
        /*  5387 */
        insertRanking("人气排行", this.fame);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateFame() {
        /*  5394 */
        updateSingleStat(MapleStat.人气, this.fame);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainFame(int famechange, boolean show) {
        /*  5401 */
        this.fame += famechange;
        /*  5402 */
        updateSingleStat(MapleStat.人气, this.fame);
        /*  5403 */
        if (show && famechange != 0) {
            /*  5404 */
            this.client.announce(MaplePacketCreator.getShowFameGain(famechange));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void updateHair(int hair) {
        /*  5409 */
        setHair(hair);
        /*  5410 */
        updateSingleStat(MapleStat.发型, hair);
        /*  5411 */
        equipChanged();
        /*       */
    }

    /*       */
    /*       */
    public void updateFace(int face) {
        /*  5415 */
        setFace(face);
        /*  5416 */
        updateSingleStat(MapleStat.脸型, face);
        /*  5417 */
        equipChanged();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeMapBanish(int mapid, String portal, String msg) {
        /*  5424 */
        dropMessage(5, msg);
        /*  5425 */
        MapleMap maps = this.client.getChannelServer().getMapFactory().getMap(mapid);
        /*  5426 */
        changeMap(maps, maps.getPortal(portal));
        /*       */
    }

    /*       */
    /*       */
    public void changeMap(MapleMap to, Point pos) {
        /*  5430 */
        changeMapInternal(to, pos, MaplePacketCreator.getWarpToMap(this, to, 128), (MaplePortal) null);
        /*       */
    }

    /*       */
    /*       */
    public void changeMap(MapleMap to) {
        /*  5434 */
        changeMapInternal(to, to.getPortal(0).getPosition(), MaplePacketCreator.getWarpToMap(this, to, 0), to.getPortal(0));
        /*       */
    }

    /*       */
    /*       */
    public void changeMap(MapleMap to, MaplePortal pto) {
        /*  5438 */
        changeMapInternal(to, pto.getPosition(), MaplePacketCreator.getWarpToMap(this, to, pto.getId()), (MaplePortal) null);
        /*       */
    }

    /*       */
    /*       */
    public void changeMapPortal(MapleMap to, MaplePortal pto) {
        /*  5442 */
        changeMapInternal(to, pto.getPosition(), MaplePacketCreator.getWarpToMap(this, to, pto.getId()), pto);
        /*       */
    }

    /*       */
    /*       */
    private void changeMapInternal(MapleMap to, Point pos, byte[] warpPacket, MaplePortal pto) {
        /*  5446 */
        if (to == null) {
            /*  5447 */
            dropMessage(5, "changeMapInternal to Null");
            /*       */
            return;
            /*       */
        }
        /*  5450 */
        if (getAntiMacro().inProgress()) {
            /*  5451 */
            dropMessage(5, "被使用测谎仪时无法操作。");
            /*       */
            return;
            /*       */
        }
        /*  5454 */
        int nowmapid = this.map.getId();
        /*  5455 */
        if (this.eventInstance != null) {
            /*  5456 */
            this.eventInstance.changedMap(this, to.getId());
            /*       */
        }
        /*  5458 */
        boolean pyramid = (this.pyramidSubway != null);
        /*  5459 */
        if (this.map.getId() == nowmapid) {
            /*  5460 */
            this.client.announce(warpPacket);
            /*  5461 */
            boolean shouldChange = (this.client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null);
            /*  5462 */
            boolean shouldState = (this.map.getId() == to.getId());
            /*  5463 */
            if (shouldChange && shouldState) {
                /*  5464 */
                to.setCheckStates(false);
                /*       */
            }
            /*  5466 */
            this.map.removePlayer(this);
            /*  5467 */
            if (shouldChange) {
                /*  5468 */
                this.map = to;
                /*  5469 */
                setStance(0);
                /*  5470 */
                setPosition(new Point(pos.x, pos.y - 50));
                /*  5471 */
                to.addPlayer(this);
                /*  5472 */
                this.stats.relocHeal(this);
                /*  5473 */
                if (shouldState) {
                    /*  5474 */
                    to.setCheckStates(true);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*  5484 */
        if (pyramid && this.pyramidSubway != null) {
            /*  5485 */
            this.pyramidSubway.onChangeMap(this, to.getId());
            /*       */
        }
        /*       */
        /*  5488 */
        if (this.eventInstance != null) {
            /*       */
            /*  5490 */
            sendDathCount();
            /*       */
            /*  5492 */
            if (this.eventInstance.getName().equals("BossZakum_EASY") || this.eventInstance
/*  5493 */.getName().equals("BossZakum_NORMAL") || this.eventInstance
/*  5494 */.getName().equals("BossZakum_CHAOS")) {
                /*  5495 */
                this.client.announce(MaplePacketCreator.showZakumStep());
                /*       */
            }
            /*       */
        }
        /*       */
        /*  5499 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void EventDeathEffect() {
        /*  5504 */
        reduceReviveCount();
        /*       */
        /*  5506 */
        sendDathCount();
        /*       */
        /*  5508 */
        playerDeadReviveEffect(30, 5);
        /*       */
    }

    /*       */
    /*       */
    public void cancelChallenge() {
        /*  5512 */
        if (this.challenge != 0 && this.client.getChannelServer() != null) {
            /*  5513 */
            MapleCharacter chr = this.client.getChannelServer().getPlayerStorage().getCharacterById(this.challenge);
            /*  5514 */
            if (chr != null) {
                /*  5515 */
                chr.dropMessage(6, getName() + " 拒绝了您的请求.");
                /*  5516 */
                chr.setChallenge(0);
                /*       */
            }
            /*  5518 */
            dropMessage(6, "您的请求被拒绝.");
            /*  5519 */
            this.challenge = 0;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void leaveMap(MapleMap map) {
        /*  5527 */
        this.controlledLock.writeLock().lock();
        /*  5528 */
        this.visibleMapObjectsLock.writeLock().lock();
        /*       */
        try {
            /*  5530 */
            for (MapleMonster mons : this.controlled) {
                /*  5531 */
                if (mons != null) {
                    /*  5532 */
                    mons.setController(null);
                    /*  5533 */
                    mons.setControllerHasAggro(false);
                    /*  5534 */
                    mons.setControllerKnowsAboutAggro(false);
                    /*  5535 */
                    map.updateMonsterController(mons);
                    /*       */
                }
                /*       */
            }
            /*  5538 */
            this.controlled.clear();
            /*  5539 */
            this.visibleMapObjects.clear();
            /*       */
        } finally {
            /*  5541 */
            this.controlledLock.writeLock().unlock();
            /*  5542 */
            this.visibleMapObjectsLock.writeLock().unlock();
            /*       */
        }
        /*  5544 */
        if (this.chair != 0) {
            /*  5545 */
            this.chair = 0;
            /*       */
        }
        /*  5547 */
        clearLinkMid();
        /*  5548 */
        cancelFishingTask();
        /*  5549 */
        cancelChallenge();
        /*  5550 */
        resetConversation();
        /*  5551 */
        cleanEvanWreckages();
        /*  5552 */
        if (getBattle() != null) {
            /*  5553 */
            getBattle().forfeit(this, true);
            /*       */
        }
        /*  5555 */
        if (!getMechDoors().isEmpty()) {
            /*  5556 */
            removeMechDoor();
            /*       */
        }
        /*  5558 */
        cancelMapTimeLimitTask();
        /*  5559 */
        if (getTrade() != null) {
            /*  5560 */
            MapleTrade.cancelTrade(getTrade(), this.client, this);
            /*       */
        }
        /*       */
        /*  5563 */
        if (this.godSchedule != null) {
            /*  5564 */
            this.godSchedule.cancel(true);
            /*  5565 */
            this.godSchedule = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeJob(int newJob) {
        /*       */
        try {
            /*  5574 */
            cancelEffectFromBuffStat(MapleBuffStat.影分身);
            /*  5575 */
            int tmpJob = newJob;
            /*  5576 */
            this.job = (short) newJob;
            /*       */
            /*  5578 */
            if (getSubcategory() == 1 && newJob == 400) {
                /*  5579 */
                tmpJob = 65936;
                /*       */
            }
            /*  5581 */
            updateSingleStat(MapleStat.职业, tmpJob);
            /*  5582 */
            if (!JobConstants.is新手职业(newJob) && !JobConstants.is神之子(newJob)) {
                /*  5583 */
                if (JobConstants.isSeparatedSpJob(newJob)) {
                    /*  5584 */
                    int changeSp = 5;
                    /*  5585 */
                    switch (JobConstants.getSkillBookByJob(newJob)) {
                        /*       */
                        case 2:
                            /*  5587 */
                            changeSp = 4;
                            /*       */
                            break;
                        /*       */
                        case 3:
                            /*  5590 */
                            changeSp = 3;
                            /*       */
                            break;
                        /*       */
                    }
                    /*  5593 */
                    this.remainingSp[JobConstants.getSkillBookByJob(newJob)] = this.remainingSp[JobConstants.getSkillBookByJob(newJob)] + changeSp;
                    /*  5594 */
                    this.client.announce(UIPacket.getSPMsg((byte) changeSp, (short) newJob));
                    /*       */
                } else {
                    /*  5596 */
                    this.remainingSp[JobConstants.getSkillBookByJob(newJob)] = this.remainingSp[JobConstants.getSkillBookByJob(newJob)] + 1;
                    /*  5597 */
                    if (newJob % 10 >= 2) {
                        /*  5598 */
                        this.remainingSp[JobConstants.getSkillBookByJob(newJob)] = this.remainingSp[JobConstants.getSkillBookByJob(newJob)] + 2;
                        /*       */
                    }
                    /*       */
                }
                /*  5601 */
                if (newJob % 10 >= 1 && this.level >= 70) {
                    /*  5602 */
                    this.remainingAp = (short) (this.remainingAp + 5);
                    /*  5603 */
                    updateSingleStat(MapleStat.AVAILABLEAP, this.remainingAp);
                    /*  5604 */
                    Skill skil = SkillFactory.getSkill(PlayerStats.getSkillByJob(1007, getJob()));
                    /*  5605 */
                    if (skil != null && getSkillLevel(skil) <= 0) {
                        /*  5606 */
                        dropMessage(-1, "恭喜你获得锻造技能。");
                        /*  5607 */
                        changeSingleSkillLevel(skil, skil.getMaxLevel(), (byte) skil.getMaxLevel());
                        /*       */
                    }
                    /*       */
                }
                /*  5610 */
                if (getLevel() > 10 && newJob % 100 == 0 && newJob % 1000 / 100 > 0) {
                    /*  5611 */
                    this.remainingSp[JobConstants.getSkillBookByJob(newJob)] = this.remainingSp[JobConstants.getSkillBookByJob(newJob)] + 3 * (getLevel() - 10);
                    /*       */
                }
                /*  5613 */
                if (JobConstants.is龙神(this.job)) {
                    /*  5614 */
                    if (this.dragon == null) {
                        /*  5615 */
                        this.dragon = new MapleDragon(this);
                        /*       */
                    }
                    /*  5617 */
                    this.dragon.setJobid(this.job);
                    /*  5618 */
                    this.dragon.sendSpawnData(this.client);
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*       */
                /*  5624 */
                updateSingleStat(MapleStat.AVAILABLESP, 0L);
                /*       */
            }
            /*       */
            /*  5627 */
            int maxhp = this.stats.getMaxHp(), maxmp = this.stats.getMaxMp();
            /*       */
            /*  5629 */
            switch (this.job) {
                /*       */
                case 100:
                    /*       */
                case 1100:
                    /*       */
                case 2100:
                    /*       */
                case 3200:
                    /*       */
                case 5100:
                    /*       */
                case 6100:
                    /*  5636 */
                    maxhp += Randomizer.rand(200, 250);
                    /*       */
                    break;
                /*       */
                case 3100:
                    /*  5639 */
                    maxhp += Randomizer.rand(200, 250);
                    /*       */
                    break;
                /*       */
                case 3110:
                    /*  5642 */
                    maxhp += Randomizer.rand(300, 350);
                    /*       */
                    break;
                /*       */
                case 3101:
                    /*       */
                case 3120:
                    /*  5646 */
                    maxhp += Randomizer.rand(500, 800);
                    /*       */
                    break;
                /*       */
                case 200:
                    /*       */
                case 2200:
                    /*       */
                case 2700:
                    /*  5651 */
                    maxmp += Randomizer.rand(100, 150);
                    /*       */
                    break;
                /*       */
                case 300:
                    /*       */
                case 400:
                    /*       */
                case 500:
                    /*       */
                case 501:
                    /*       */
                case 509:
                    /*       */
                case 2300:
                    /*       */
                case 2400:
                    /*       */
                case 3300:
                    /*       */
                case 3500:
                    /*       */
                case 3600:
                    /*  5663 */
                    maxhp += Randomizer.rand(100, 150);
                    /*  5664 */
                    maxmp += Randomizer.rand(25, 50);
                    /*       */
                    break;
                /*       */
                case 110:
                    /*       */
                case 120:
                    /*       */
                case 130:
                    /*       */
                case 1110:
                    /*       */
                case 2110:
                    /*       */
                case 3210:
                    /*       */
                case 5110:
                    /*  5673 */
                    maxhp += Randomizer.rand(300, 350);
                    /*       */
                    break;
                /*       */
                case 6110:
                    /*  5676 */
                    maxhp += Randomizer.rand(350, 400);
                    /*  5677 */
                    maxmp += Randomizer.rand(120, 180);
                    /*       */
                    break;
                /*       */
                case 210:
                    /*       */
                case 220:
                    /*       */
                case 230:
                    /*       */
                case 2710:
                    /*  5683 */
                    maxmp += Randomizer.rand(400, 450);
                    /*       */
                    break;
                /*       */
                case 310:
                    /*       */
                case 320:
                    /*       */
                case 410:
                    /*       */
                case 420:
                    /*       */
                case 430:
                    /*       */
                case 510:
                    /*       */
                case 520:
                    /*       */
                case 530:
                    /*       */
                case 570:
                    /*       */
                case 580:
                    /*       */
                case 590:
                    /*       */
                case 1310:
                    /*       */
                case 1410:
                    /*       */
                case 2310:
                    /*       */
                case 2410:
                    /*       */
                case 3310:
                    /*       */
                case 3510:
                    /*       */
                case 3610:
                    /*  5703 */
                    maxhp += Randomizer.rand(200, 250);
                    /*  5704 */
                    maxhp += Randomizer.rand(150, 200);
                    /*       */
                    break;
                /*       */
                case 800:
                    /*       */
                case 900:
                    /*  5708 */
                    maxhp += 99999;
                    /*  5709 */
                    maxmp += 99999;
                    /*       */
                    break;
                /*       */
            }
            /*  5712 */
            if (maxhp >= getMaxHpForSever()) {
                /*  5713 */
                maxhp = getMaxHpForSever();
                /*       */
            }
            /*  5715 */
            if (maxmp >= getMaxMpForSever()) {
                /*  5716 */
                maxmp = getMaxMpForSever();
                /*       */
            }
            /*  5718 */
            if (JobConstants.isNotMpJob(this.job)) {
                /*  5719 */
                maxmp = 10;
                /*       */
            }
            /*  5721 */
            this.stats.setInfo(maxhp, maxmp, this.stats.getCurrentMaxHp(), this.stats.getCurrentMaxMp(this.job));
            /*  5722 */
            this.characterCard.recalcLocalStats(this);
            /*  5723 */
            this.stats.recalcLocalStats(this);
            /*  5724 */
            List<Pair<MapleStat, Long>> statup = new ArrayList<>(4);
            /*  5725 */
            statup.add(new Pair(MapleStat.HP, Long.valueOf(this.stats.getCurrentMaxHp())));
            /*  5726 */
            statup.add(new Pair(MapleStat.MP, Long.valueOf(this.stats.getCurrentMaxMp(this.job))));
            /*  5727 */
            statup.add(new Pair(MapleStat.MAXHP, Long.valueOf(maxhp)));
            /*  5728 */
            statup.add(new Pair(MapleStat.MAXMP, Long.valueOf(maxmp)));
            /*  5729 */
            this.client.announce(MaplePacketCreator.updatePlayerStats(statup, this));
            /*  5730 */
            this.map.broadcastMessage(this, EffectPacket.showForeignEffect(getId(), 13), false);
            /*  5731 */
            this.map.broadcastMessage(this, MaplePacketCreator.updateCharLook(this), false);
            /*  5732 */
            silentPartyUpdate();
            /*  5733 */
            guildUpdate();
            /*  5734 */
            familyUpdate();
            /*  5735 */
            if (this.dragon != null) {
                /*  5736 */
                this.map.broadcastMessage(SummonPacket.removeDragon(this.id));
                /*  5737 */
                this.dragon = null;
                /*       */
            }
            /*  5739 */
            if (this.lw != null) {
                /*  5740 */
                this.lw = null;
                /*       */
            }
            /*  5742 */
            baseSkills();
            /*  5743 */
            if (JobConstants.is龙神(newJob)) {
                /*  5744 */
                if (getBuffedValue(MapleBuffStat.骑兽技能) != null) {
                    /*  5745 */
                    cancelBuffStats(new MapleBuffStat[]{MapleBuffStat.骑兽技能});
                    /*       */
                }
                /*  5747 */
                makeDragon();
                /*       */
            }
            /*  5749 */
            if ((newJob >= 4200 && newJob <= 4212) || newJob == 4002) {
                /*  5750 */
                if (getBuffedValue(MapleBuffStat.骑兽技能) != null) {
                    /*  5751 */
                    cancelBuffStats(new MapleBuffStat[]{MapleBuffStat.骑兽技能});
                    /*       */
                }
                /*  5753 */
                makeLittleWhite();
                /*       */
            }
            /*  5755 */
            if (newJob == 3300) {
                /*  5756 */
                String customData = "1=1;2=1;3=1;4=1;5=1;6=1;7=1;8=1;9=1";
                /*  5757 */
                setQuestAdd(MapleQuest.getInstance(23008), (byte) 1, customData);
                /*  5758 */
                this.client.announce(MaplePacketCreator.updateInfoQuest(23008, customData));
                /*  5759 */
                this.client.announce(MaplePacketCreator.updateJaguar(this));
                /*       */
            }
            /*  5761 */
            this.playerObservable.update();
            /*  5762 */
        } catch (Exception e) {
            /*  5763 */
            log.error("转职错误", e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void checkZeroItem() {
        /*  5768 */
        if (this.job != 10112 || this.level < 100) {
            /*       */
            return;
            /*       */
        }
        /*  5771 */
        if (getKeyValue("Zero_Item") == null) {
            /*  5772 */
            MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
            /*       */
            /*  5774 */
            int[] toRemovePos = {-9, -5, -7};
            /*  5775 */
            for (int pos : toRemovePos) {
                /*  5776 */
                Item toRemove = getInventory(MapleInventoryType.EQUIPPED).getItem((short) pos);
                /*  5777 */
                if (toRemove != null) {
                    /*  5778 */
                    MapleInventoryManipulator.removeFromSlot(this.client, MapleInventoryType.EQUIPPED, toRemove.getPosition(), toRemove.getQuantity(), false);
                    /*       */
                }
                /*       */
            }
            /*       */
            /*  5782 */
            int[][] equips = {{1003840, -1}, {1032202, -4}, {1052606, -5}, {1072814, -7}, {1082521, -8}, {1102552, -9}, {1113059, -12}, {1113060, -13}, {1113061, -15}, {1113062, -16}, {1122260, -17}, {1132231, -29}, {1152137, -30}};
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            /*  5796 */
            for (int[] i : equips) {
                /*  5797 */
                if (ii.itemExists(i[0])) {
                    /*  5798 */
                    Equip equip = (Equip) ii.getEquipById(i[0]);
                    /*  5799 */
                    equip.setPosition((short) (byte) i[1]);
                    /*  5800 */
                    equip.setQuantity((short) 1);
                    /*  5801 */
                    if (i[1] != -12 && i[1] != -13 && i[1] != -15 && i[1] != -16 && i[1] != -30) {
                        /*  5802 */
                        equip.renewPotential(false);
                        /*       */
                    }
                    /*  5804 */
                    equip.setGMLog("系统赠送");
                    /*  5805 */
                    forceReAddItem_NoUpdate((Item) equip, MapleInventoryType.EQUIPPED);
                    /*  5806 */
                    this.client.announce(InventoryPacket.modifyInventory(false, Collections.singletonList(new ModifyInventory(0, (Item) equip))));
                    /*       */
                }
                /*       */
            }
            /*  5809 */
            equipChanged();
            /*  5810 */
            MapleInventoryManipulator.addById(this.client, 1142634, (short) 1, "系统赠送");
            /*  5811 */
            MapleInventoryManipulator.addById(this.client, 2001530, (short) 100, "系统赠");
            /*       */
            /*  5813 */
            Map<Integer, SkillEntry> list = new HashMap<>();
            /*  5814 */
            int[] skillIds = {101000103, 101000203};
            /*  5815 */
            for (int i : skillIds) {
                /*  5816 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5817 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5818 */
                    list.put(Integer.valueOf(i), new SkillEntry(8, (byte) skil.getMaxLevel(), -1L));
                    /*       */
                }
                /*       */
            }
            /*  5821 */
            if (!list.isEmpty()) {
                /*  5822 */
                changeSkillsLevel(list);
                /*       */
            }
            /*  5824 */
            setKeyValue("Zero_Item", "True");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void checkZeroWeapon() {
        /*  5829 */
        if (this.level < 100) {
            /*       */
            return;
            /*       */
        }
        /*  5832 */
        int lazuli = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11).getItemId();
        /*  5833 */
        int lapis = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -10).getItemId();
        /*  5834 */
        if (lazuli == getZeroWeapon(false) && lapis == getZeroWeapon(true)) {
            /*       */
            return;
            /*       */
        }
        /*  5837 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /*  5838 */
        for (int i = 0; i < 2; i++) {
            /*  5839 */
            int itemId = (i == 0) ? getZeroWeapon(false) : getZeroWeapon(true);
            /*  5840 */
            Equip equip = (Equip) ii.getEquipById(itemId);
            /*  5841 */
            equip.setPosition((short) ((i == 0) ? -11 : -10));
            /*  5842 */
            equip.setQuantity((short) 1);
            /*  5843 */
            equip.setGMLog("神之子升级赠送, 时间:" + DateUtil.getNowTime());
            /*  5844 */
            equip.renewPotential(false);
            /*  5845 */
            forceReAddItem_NoUpdate((Item) equip, MapleInventoryType.EQUIPPED);
            /*  5846 */
            this.client.announce(InventoryPacket.modifyInventory(false, Collections.singletonList(new ModifyInventory(0, (Item) equip))));
            /*       */
        }
        /*  5848 */
        equipChanged();
        /*       */
    }

    /*       */
    /*       */
    public int getZeroWeapon(boolean lapis) {
        /*  5852 */
        if (this.level < 100) {
            /*  5853 */
            return lapis ? 1562000 : 1572000;
            /*       */
        }
        /*  5855 */
        int weapon = lapis ? 1562001 : 1572001;
        /*  5856 */
        if (this.level < 160) {
            /*  5857 */
            weapon += this.level % 100 / 10;
            /*  5858 */
        } else if (this.level < 170) {
            /*  5859 */
            weapon += 5;
            /*       */
        } else {
            /*  5861 */
            weapon += 6;
            /*       */
        }
        /*  5863 */
        return weapon;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void baseSkills() {
        /*  5870 */
        checkZeroItem();
        /*  5871 */
        checkInnerSkill();
        /*       */
        /*  5873 */
        checkBeastTamerSkill();
        /*  5874 */
        checkHyperAP();
        /*  5875 */
        Map<Integer, SkillEntry> list = new HashMap<>();
        /*  5876 */
        if (JobConstants.getJobNumber(this.job) >= 3) {
            /*  5877 */
            List<Integer> baseSkills = SkillFactory.getSkillsByJob(this.job);
            /*  5878 */
            if (baseSkills != null) {
                /*  5879 */
                for (Iterator<Integer> iterator = baseSkills.iterator(); iterator.hasNext(); ) {
                    int i = ((Integer) iterator.next()).intValue();
                    /*  5880 */
                    Skill skil = SkillFactory.getSkill(i);
                    /*       */
                    /*  5882 */
                    if (skil != null && !skil.isInvisible() && SkillConstants.isFourthJob(skil.getId()) && getSkillLevel(skil) <= 0 && getMasterLevel(skil) <= 0 && skil.getMasterLevel() > 0) {
                        /*  5883 */
                        list.put(Integer.valueOf(i), new SkillEntry(0, (byte) (JobConstants.is超能力者(this.job) ? skil.getMaxLevel() : skil.getMasterLevel()), SkillFactory.getDefaultSExpiry(skil)));
                        continue;
                        /*  5884 */
                    }
                    if (skil != null && skil.getName() != null && skil.getName().contains("冒险岛勇士") && getSkillLevel(skil) <= 0 && getMasterLevel(skil) <= 0) {
                        /*  5885 */
                        list.put(Integer.valueOf(i), new SkillEntry(0, (byte) 10, SkillFactory.getDefaultSExpiry(skil)));
                        continue;
                        /*  5886 */
                    }
                    if (skil != null && skil.getName() != null && (skil.getName().contains("希纳斯的骑士") || skil.getName().contains("希纳斯骑士")) && getSkillLevel(skil) <= 0 && getMasterLevel(skil) <= 0) {
                        /*  5887 */
                        list.put(Integer.valueOf(i), new SkillEntry(0, (byte) 30, SkillFactory.getDefaultSExpiry(skil)));
                        /*       */
                    }
                }
                /*       */
                /*       */
            }
            /*       */
        }
        /*       */
        /*  5893 */
        if (this.job >= 3300 && this.job <= 3312) {
            /*  5894 */
            int[] ss = {30001061, 30001062, 33001001, 33001007, 33001016, 33001025, 33001006};
            /*  5895 */
            for (int i : ss) {
                /*  5896 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5897 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5898 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5901 */
        } else if (JobConstants.is机械师(this.job)) {
            /*  5902 */
            int[] ss = {30001068, 30000227};
            /*  5903 */
            for (int i : ss) {
                /*  5904 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5905 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5906 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5909 */
        } else if (JobConstants.is火炮手(this.job) && this.level >= 10) {
            /*  5910 */
            Skill skil = SkillFactory.getSkill(110);
            /*  5911 */
            if (skil != null && getSkillLevel(skil) <= 0) {
                /*  5912 */
                list.put(Integer.valueOf(110), new SkillEntry(1, (byte) 1, -1L));
                /*       */
            }
            /*  5914 */
        } else if (JobConstants.is骑士团(this.job)) {
            /*  5915 */
            int[] ss = {10001244, 10001245, 10000246, 10000255, 10000252, 10000250, 10001254};
            /*  5916 */
            if (JobConstants.is炎术士(this.job)) {
                /*  5917 */
                ss[2] = 10000248;
                /*  5918 */
                ss[3] = 10000256;
                /*  5919 */
            } else if (JobConstants.is风灵使者(this.job)) {
                /*  5920 */
                ss[2] = 10000247;
                /*  5921 */
                ss[3] = 10000257;
                /*  5922 */
            } else if (JobConstants.is夜行者(this.job)) {
                /*  5923 */
                ss[2] = 10000249;
                /*  5924 */
                ss[3] = 10000258;
                /*  5925 */
            } else if (JobConstants.is奇袭者(this.job)) {
                /*  5926 */
                ss[3] = 10000259;
                /*       */
            }
            /*  5928 */
            for (int i : ss) {
                /*  5929 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5930 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5931 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5934 */
            if (JobConstants.is夜行者(this.job)) {
                /*  5935 */
                int[] ss2 = {14001026, 14001024};
                /*  5936 */
                for (int i : ss2) {
                    /*  5937 */
                    Skill skil = SkillFactory.getSkill(i);
                    /*  5938 */
                    if (skil != null && getSkillLevel(skil) <= 0) {
                        /*  5939 */
                        list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*  5943 */
        } else if (JobConstants.is恶魔猎手(this.job) && this.level >= 10 && this.job != 3001) {
            /*  5944 */
            int[] ss = {30010110, 30010111, 30011159, 30010185, 30010183, 30010184, 30010186};
            /*  5945 */
            for (int i : ss) {
                /*  5946 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5947 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5948 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5951 */
        } else if (JobConstants.is恶魔复仇者(this.job) && this.level >= 10) {
            /*  5952 */
            int[] ss = {30011109, 30010110, 30010185, 30010241, 30010242, 30010230, 30010231};
            /*  5953 */
            for (int i : ss) {
                /*  5954 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5955 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5956 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5959 */
        } else if (JobConstants.is尖兵(this.job) && this.level >= 10) {
            /*  5960 */
            int[] ss = {30020232, 30020234, 30021235, 30021236, 30021237, 30020240};
            /*  5961 */
            for (int i : ss) {
                /*  5962 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5963 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5964 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5967 */
        } else if (JobConstants.is双弩精灵(this.job) && this.level >= 10) {
            /*  5968 */
            int[] ss = {20021110, 20020111, 20020112, 20020109, 20021160, 20021161};
            /*  5969 */
            for (int i : ss) {
                /*  5970 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5971 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5972 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5975 */
        } else if (JobConstants.is龙的传人(this.job) && this.level >= 10) {
            /*  5976 */
            Skill skil = SkillFactory.getSkill(228);
            /*  5977 */
            if (skil != null && getSkillLevel(skil) <= 0) {
                /*  5978 */
                list.put(Integer.valueOf(228), new SkillEntry(1, (byte) 1, -1L));
                /*       */
            }
            /*  5980 */
            skil = SkillFactory.getSkill(1214);
            /*  5981 */
            if (skil != null && getSkillLevel(skil) <= 0) {
                /*  5982 */
                list.put(Integer.valueOf(1214), new SkillEntry(1, (byte) 1, -1L));
                /*       */
            }
            /*  5984 */
        } else if (JobConstants.is隐月(this.job)) {
            /*  5985 */
            int[] ss = {20050285, 20051284, 25001000};
            /*  5986 */
            for (int i : ss) {
                /*  5987 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5988 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5989 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  5992 */
        } else if (JobConstants.is幻影(this.job) && this.level >= 10) {
            /*  5993 */
            int[] ss = {20031203, 20030204, 20031205, 20030206, 20031207, 20031208, 20031160, 20031161};
            /*  5994 */
            for (int i : ss) {
                /*  5995 */
                Skill skil = SkillFactory.getSkill(i);
                /*  5996 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  5997 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6000 */
            if (this.job == 2412) {
                /*  6001 */
                Skill skil = SkillFactory.getSkill(20031210);
                /*  6002 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6003 */
                    list.put(Integer.valueOf(20031210), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*  6005 */
                skil = SkillFactory.getSkill(20031209);
                /*  6006 */
                if (skil != null && getSkillLevel(skil) > 0) {
                    /*  6007 */
                    list.put(Integer.valueOf(20031209), new SkillEntry(0, (byte) 0, -1L));
                    /*       */
                }
                /*       */
            } else {
                /*  6010 */
                Skill skil = SkillFactory.getSkill(20031209);
                /*  6011 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6012 */
                    list.put(Integer.valueOf(20031209), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*  6014 */
                skil = SkillFactory.getSkill(20031210);
                /*  6015 */
                if (skil != null && getSkillLevel(skil) > 0) {
                    /*  6016 */
                    list.put(Integer.valueOf(20031210), new SkillEntry(0, (byte) 0, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6019 */
        } else if (JobConstants.is夜光(this.job) && this.level >= 10) {
            /*  6020 */
            int[] ss = {20040216, 20040217, 20040218, 20040219, 20041239, 20040221, 20041222};
            /*  6021 */
            for (int i : ss) {
                /*  6022 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6023 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6024 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6027 */
            int[] fixskills = {27001100, 27001201, 27000207};
            /*  6028 */
            for (int f : fixskills) {
                /*  6029 */
                Skill skil = SkillFactory.getSkill(f);
                /*  6030 */
                if (skil != null && getSkillLevel(skil) <= 0 && getMasterLevel(skil) <= 0 && skil.getMasterLevel() > 0) {
                    /*  6031 */
                    list.put(Integer.valueOf(f), new SkillEntry(1, (byte) skil.getMasterLevel(), SkillFactory.getDefaultSExpiry(skil)));
                    /*       */
                }
                /*       */
            }
            /*  6034 */
        } else if (this.job >= 432 && this.job <= 434) {
            /*  6035 */
            int[] fixskills = {4311003, 4321006, 4330009, 4341009, 4341002};
            /*  6036 */
            for (int i : fixskills) {
                /*  6037 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6038 */
                if (skil != null && !skil.isInvisible() && SkillConstants.isFourthJob(skil.getId()) && skil.getMasterLevel() > 0) {
                    /*  6039 */
                    if (getSkillLevel(skil) <= 0 && getMasterLevel(skil) <= 0) {
                        /*  6040 */
                        list.put(Integer.valueOf(i), new SkillEntry(0, (byte) skil.getMaxLevel(), SkillFactory.getDefaultSExpiry(skil)));
                        /*  6041 */
                    } else if (getMasterLevel(skil) <= skil.getMaxLevel()) {
                        /*  6042 */
                        list.put(Integer.valueOf(i), new SkillEntry((byte) getSkillLevel(skil), (byte) skil.getMaxLevel(), SkillFactory.getDefaultSExpiry(skil)));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*  6046 */
        } else if (JobConstants.is米哈尔(this.job) && this.level >= 10) {
            /*  6047 */
            int[] ss = {50001214};
            /*  6048 */
            for (int i : ss) {
                /*  6049 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6050 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6051 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6054 */
        } else if (JobConstants.is狂龙战士(this.job) && this.level >= 10) {
            /*  6055 */
            int[] ss = {60001216, 60001217, 60001218, 60000219, 60000222};
            /*  6056 */
            for (int i : ss) {
                /*  6057 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6058 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6059 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6062 */
        } else if (JobConstants.is爆莉萌天使(this.job) && this.level >= 10) {
            /*  6063 */
            int[] ss = {60011216, 60011218, 60011219, 60011221, 60011222};
            /*  6064 */
            for (int i : ss) {
                /*  6065 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6066 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6067 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6070 */
        } else if (this.job == 10112 && this.level >= 100) {
            /*  6071 */
            List<Integer> baseSkills = SkillFactory.getSkillsByJob(10100);
            /*  6072 */
            baseSkills.addAll(SkillFactory.getSkillsByJob(10110));
            /*  6073 */
            baseSkills.addAll(SkillFactory.getSkillsByJob(10111));
            /*  6074 */
            baseSkills.addAll(SkillFactory.getSkillsByJob(10112));
            /*  6075 */
            for (Iterator<Integer> iterator = baseSkills.iterator(); iterator.hasNext(); ) {
                int i = ((Integer) iterator.next()).intValue();
                /*  6076 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6077 */
                if (skil != null && !skil.isInvisible() && SkillConstants.isFourthJob(skil.getId()) && getSkillLevel(skil) <= 0 && getMasterLevel(skil) <= 0 && skil.getMasterLevel() > 0) {
                    /*  6078 */
                    list.put(Integer.valueOf(i), new SkillEntry(0, (byte) skil.getMaxLevel(), SkillFactory.getDefaultSExpiry(skil)));
                    /*       */
                }
            }
            /*       */
            /*  6081 */
            int[] skillIds = {100001262, 100000282, 100001263, 100001264, 100001265, 100001266, 100001268, 100000279, 100000267, 100001261, 100001274, 100001272, 100001283, 100001005};
            /*  6082 */
            for (int i : skillIds) {
                /*  6083 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6084 */
                if (skil != null && skil.canBeLearnedBy(getJob()) && getSkillLevel(skil) <= 0) {
                    /*  6085 */
                    list.put(Integer.valueOf(i), new SkillEntry((byte) skil.getMaxLevel(), (byte) skil.getMaxLevel(), -1L));
                    /*       */
                }
                /*       */
            }
            /*  6088 */
        } else if (JobConstants.is剑豪(this.job)) {
            /*  6089 */
            int[] ss = {40010000, 40010067, 40011288, 40011291, 40011292, 40011290, 41001010, 40011289};
            /*  6090 */
            for (int i : ss) {
                /*  6091 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6092 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6093 */
                    list.put(Integer.valueOf(i), new SkillEntry((byte) skil.getMaxLevel(), (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6096 */
        } else if (JobConstants.is阴阳师(this.job)) {
            /*  6097 */
            int[] ss = {40020000, 40020001, 40020109, 42000008};
            /*  6098 */
            for (int i : ss) {
                /*  6099 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6100 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6101 */
                    list.put(Integer.valueOf(i), new SkillEntry((byte) skil.getMaxLevel(), (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6104 */
        } else if (JobConstants.is超能力者(this.job)) {
            /*  6105 */
            int[] ss = {140001289, 142001007};
            /*  6106 */
            for (int i : ss) {
                /*  6107 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6108 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6109 */
                    list.put(Integer.valueOf(i), new SkillEntry((byte) skil.getMaxLevel(), (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6112 */
        } else if (JobConstants.is爆破手(this.job) && this.level >= 10) {
            /*  6113 */
            int[] ss = {30001281, 37001001, 37000010};
            /*  6114 */
            for (int i : ss) {
                /*  6115 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6116 */
                if (this.job >= i / 10000 && skil != null && getSkillLevel(skil) <= 0) {
                    /*  6117 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6120 */
        } else if (JobConstants.is影魂异人(this.job) && this.level >= 10) {
            /*  6121 */
            int[] ss = {150010079, 150010241};
            /*  6122 */
            for (int i : ss) {
                /*  6123 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6124 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6125 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6128 */
            if (this.level >= 30) {
                /*  6129 */
                Skill skil = SkillFactory.getSkill(155101006);
                /*  6130 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6131 */
                    list.put(Integer.valueOf(155101006), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6134 */
        } else if (JobConstants.is虎影(this.job) && this.level >= 10) {
            /*  6135 */
            int[] ss = {164001004};
            /*  6136 */
            for (int i : ss) {
                /*  6137 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6138 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6139 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*  6142 */
        } else if (JobConstants.is御剑骑士(this.job) && this.level >= 10) {
            /*  6143 */
            int[] ss = {151001004, 150020241};
            /*  6144 */
            for (int i : ss) {
                /*  6145 */
                Skill skil = SkillFactory.getSkill(i);
                /*  6146 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /*  6147 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
        /*  6152 */
        List<Integer> fixSkills = SkillFactory.getSkillsByJob(this.job);
        /*  6153 */
        if (fixSkills != null) {
            /*  6154 */
            for (Iterator<Integer> iterator = fixSkills.iterator(); iterator.hasNext(); ) {
                int i = ((Integer) iterator.next()).intValue();
                /*  6155 */
                Skill sk = SkillFactory.getSkill(i);
                /*  6156 */
                if (sk != null && sk.getFixLevel() > 0 &&
                        /*  6157 */           sk.canBeLearnedBy(getJob()) && getSkillLevel(sk) <= 0) {
                    /*  6158 */
                    list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                    /*       */
                }
            }
            /*       */
            /*       */
        }
        /*       */
        /*  6163 */
        if (!list.isEmpty()) {
            /*  6164 */
            changeSkillsLevel(list);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void ChangeAutoAtkType(int skillid) {
        /*  6169 */
        if (!JobConstants.is影魂异人(getJob()) || this.map == null) {
            /*       */
            return;
            /*       */
        }
        /*  6172 */
        int questId = 1544;
        /*       */
        /*       */
        /*  6175 */
        if (!this.questinfo.containsKey(Integer.valueOf(questId))) {
            /*  6176 */
            updateInfoQuest(questId, "155001103=0;155111207=0");
            /*       */
        }
        /*       */
        /*       */
        /*  6180 */
        if (!containsInfoQuest(questId, "155001103") || !containsInfoQuest(questId, "155111207")) {
            /*  6181 */
            updateInfoQuest(questId, "155001103=0;155111207=0");
            /*       */
        }
        /*       */
        /*  6184 */
        if (skillid == 155001103) {
            /*  6185 */
            setInfoQuestStat(questId, "155001103", containsInfoQuest(questId, "155001103=0") ? "1" : "0");
            /*  6186 */
        } else if (skillid == 155111207) {
            /*  6187 */
            setInfoQuestStat(questId, "155111207", containsInfoQuest(questId, "155111207=0") ? "1" : "0");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkAutoAtkType() {
        /*  6195 */
        if (!JobConstants.is影魂异人(getJob())) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  6199 */
        if (!this.questinfo.containsKey(Integer.valueOf(1544))) {
            /*  6200 */
            updateInfoQuest(1544, "155001103=0;155111207=0", false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void ResetAllNz(int mode) {
        /*  6205 */
        int shownz = 0;
        /*  6206 */
        switch (mode) {
            /*       */
            case 1:
                /*  6208 */
                this.specialStats.setNZ1(0);
                /*  6209 */
                shownz = this.specialStats.getNZ1();
                /*       */
                break;
            /*       */
            case 2:
                /*  6212 */
                this.specialStats.setNZ2(0);
                /*  6213 */
                shownz = this.specialStats.getNZ2();
                /*       */
                break;
            /*       */
            case 3:
                /*  6216 */
                this.specialStats.setNZ3(0);
                /*  6217 */
                shownz = this.specialStats.getNZ3();
                /*       */
                break;
            /*       */
            case 4:
                /*  6220 */
                this.specialStats.setNZ4(0);
                /*  6221 */
                shownz = this.specialStats.getNZ4();
                /*       */
                break;
            /*       */
        }
        /*  6224 */
        this.client.announce(BuffPacket.show念珠(mode, this.job, shownz));
        /*       */
    }

    /*       */
    /*       */
    public void makeDragon() {
        /*  6228 */
        this.dragon = new MapleDragon(this);
        /*       */
    }

    /*       */
    /*       */
    public MapleDragon getDragon() {
        /*  6232 */
        return this.dragon;
        /*       */
    }

    /*       */
    /*       */
    public void setDragon(MapleDragon d) {
        /*  6236 */
        this.dragon = d;
        /*       */
    }

    /*       */
    /*       */
    public void makeLittleWhite() {
        /*  6240 */
        this.lw = new MapleLittleWhite(this);
        /*  6241 */
        this.map.broadcastMessage(SummonPacket.spawnLittleWhite(this.lw));
        /*       */
    }

    /*       */
    /*       */
    public MapleLittleWhite getLittleWhite() {
        /*  6245 */
        return this.lw;
        /*       */
    }

    /*       */
    /*       */
    public void setLittleWhite(MapleLittleWhite lw) {
        /*  6249 */
        this.lw = lw;
        /*       */
    }

    /*       */
    /*       */
    public void gainAp(short ap) {
        /*  6253 */
        this.remainingAp = (short) (this.remainingAp + ap);
        /*  6254 */
        updateSingleStat(MapleStat.AVAILABLEAP, this.remainingAp);
        /*       */
    }

    /*       */
    /*       */
    public void gainSP(int sp) {
        /*  6258 */
        this.remainingSp[JobConstants.getSkillBookByJob(this.job)] = this.remainingSp[JobConstants.getSkillBookByJob(this.job)] + sp;
        /*  6259 */
        updateSingleStat(MapleStat.AVAILABLESP, 0L);
        /*  6260 */
        this.client.announce(UIPacket.getSPMsg((byte) sp, this.job));
        /*       */
    }

    /*       */
    /*       */
    public void gainSP(int sp, int skillbook) {
        /*  6264 */
        this.remainingSp[skillbook] = this.remainingSp[skillbook] + sp;
        /*  6265 */
        updateSingleStat(MapleStat.AVAILABLESP, 0L);
        /*  6266 */
        this.client.announce(UIPacket.getSPMsg((byte) sp, (short) 0));
        /*       */
    }

    /*       */
    /*       */
    public void resetSP(int sp) {
        /*  6270 */
        for (int i = 0; i < this.remainingSp.length; i++) {
            /*  6271 */
            this.remainingSp[i] = sp;
            /*       */
        }
        /*  6273 */
        updateSingleStat(MapleStat.AVAILABLESP, 0L);
        /*       */
    }

    /*       */
    /*       */
    public void resetAPSP() {
        /*  6277 */
        resetSP(0);
        /*  6278 */
        gainAp((short) -this.remainingAp);
        /*       */
    }

    /*       */
    /*       */
    public int getHitCountBat() {
        /*  6282 */
        return this.hitcountbat;
        /*       */
    }

    /*       */
    /*       */
    public void setHitCountBat(int hitcount) {
        /*  6286 */
        this.hitcountbat = hitcount;
        /*       */
    }

    /*       */
    /*       */
    public int getBatCount() {
        /*  6290 */
        return this.batcount;
        /*       */
    }

    /*       */
    /*       */
    public void setBatCount(int count) {
        /*  6294 */
        this.batcount = count;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<Integer> getProfessions() {
        /*  6301 */
        List<Integer> prof = new ArrayList<>();
        /*  6302 */
        for (int i = 9200; i <= 9204; i++) {
            /*  6303 */
            if (getProfessionLevel(i * 10000) > 0) {
                /*  6304 */
                prof.add(Integer.valueOf(i));
                /*       */
            }
            /*       */
        }
        /*  6307 */
        return prof;
        /*       */
    }

    /*       */
    /*       */
    public byte getProfessionLevel(int id) {
        /*  6311 */
        int ret = getSkillLevel(id);
        /*  6312 */
        if (ret <= 0) {
            /*  6313 */
            return 0;
            /*       */
        }
        /*  6315 */
        return (byte) (ret >>> 24 & 0xFF);
        /*       */
    }

    /*       */
    /*       */
    public short getProfessionExp(int id) {
        /*  6319 */
        int ret = getSkillLevel(id);
        /*  6320 */
        if (ret <= 0) {
            /*  6321 */
            return 0;
            /*       */
        }
        /*  6323 */
        return (short) (ret & 0xFFFF);
        /*       */
    }

    /*       */
    /*       */
    public boolean addProfessionExp(int id, int expGain) {
        /*  6327 */
        int ret = getProfessionLevel(id);
        /*  6328 */
        if (ret <= 0 || ret >= 10) {
            /*  6329 */
            return false;
            /*       */
        }
        /*  6331 */
        int newExp = getProfessionExp(id) + expGain;
        /*  6332 */
        if (newExp >= GameConstants.getProfessionEXP(ret)) {
            /*       */
            /*  6334 */
            changeProfessionLevelExp(id, ret + 1, newExp - GameConstants.getProfessionEXP(ret));
            /*  6335 */
            int traitGain = (int) Math.pow(2.0D, (ret + 1));
            /*  6336 */
            switch (id) {
                /*       */
                case 92000000:
                    /*  6338 */
                    ((MapleTrait) this.traits.get(MapleTraitType.sense)).addExp(traitGain, this);
                    /*       */
                    break;
                /*       */
                case 92010000:
                    /*  6341 */
                    ((MapleTrait) this.traits.get(MapleTraitType.will)).addExp(traitGain, this);
                    /*       */
                    break;
                /*       */
                case 92020000:
                    /*       */
                case 92030000:
                    /*       */
                case 92040000:
                    /*  6346 */
                    ((MapleTrait) this.traits.get(MapleTraitType.craft)).addExp(traitGain, this);
                    /*       */
                    break;
                /*       */
            }
            /*  6349 */
            return true;
            /*       */
        }
        /*  6351 */
        changeProfessionLevelExp(id, ret, newExp);
        /*  6352 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeProfessionLevelExp(int id, int level, int exp) {
        /*  6360 */
        changeSingleSkillLevel(SkillFactory.getSkill(id), ((level & 0xFF) << 24) + (exp & 0xFFFF), (byte) 10);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeSkillLevel(Skill skill, byte newLevel, byte newMasterlevel) {
        /*  6367 */
        changeSingleSkillLevel(skill, newLevel, newMasterlevel, -1L);
        /*       */
    }

    /*       */
    /*       */
    public void changeSingleSkillLevel(Skill skill, int newLevel, byte newMasterlevel) {
        /*  6371 */
        if (skill == null) {
            /*       */
            return;
            /*       */
        }
        /*  6374 */
        changeSingleSkillLevel(skill, newLevel, newMasterlevel, SkillFactory.getDefaultSExpiry(skill));
        /*       */
    }

    /*       */
    /*       */
    public void changeSingleSkillLevel(int skillid, int newLevel, byte newMasterlevel) {
        /*  6378 */
        Skill skill = SkillFactory.getSkill(skillid);
        /*  6379 */
        changeSingleSkillLevel(skill, newLevel, newMasterlevel, SkillFactory.getDefaultSExpiry(skill));
        /*       */
    }

    /*       */
    /*       */
    public void changeSingleSkillLevel(int skillid, int newLevel, byte newMasterlevel, long expiration) {
        /*  6383 */
        Skill skill = SkillFactory.getSkill(skillid);
        /*  6384 */
        changeSingleSkillLevel(skill, newLevel, newMasterlevel, SkillFactory.getDefaultSExpiry(skill));
        /*       */
    }

    /*       */
    /*       */
    public void changeSingleSkillLevel(Skill skill, int newLevel, byte newMasterlevel, long expiration) {
        /*  6388 */
        Map<Integer, SkillEntry> list = new HashMap<>();
        /*  6389 */
        boolean hasRecovery = false, recalculate = false;
        /*  6390 */
        if (changeSkillData(skill, newLevel, newMasterlevel, expiration)) {
            /*  6391 */
            list.put(Integer.valueOf(skill.getId()), new SkillEntry(newLevel, newMasterlevel, expiration, getSkillTeachId(skill), getSkillPosition(skill)));
            /*  6392 */
            if (SkillConstants.isRecoveryIncSkill(skill.getId())) {
                /*  6393 */
                hasRecovery = true;
                /*       */
            }
            /*  6395 */
            if (skill.getId() < 80000000) {
                /*  6396 */
                recalculate = true;
                /*       */
            }
            /*       */
        }
        /*  6399 */
        if (list.isEmpty()) {
            /*       */
            return;
            /*       */
        }
        /*  6402 */
        this.client.announce(MaplePacketCreator.updateSkills(list));
        /*  6403 */
        reUpdateStat(hasRecovery, recalculate);
        /*       */
    }

    /*       */
    /*       */
    public void changeTeachSkillsLevel() {
        /*  6407 */
        getSkills().forEach((skillid, ao2) -> {
            /*       */
            Skill skill = SkillFactory.getSkill(skillid.intValue());
            /*       */
            if (skill != null && skill.isTeachSkills()) {
                /*       */
                changeSkillData(skill, SkillConstants.getLinkSkillslevel(skill.getMaxLevel(), skill, 0, this.level), (byte) skill.getMasterLevel(), ao2.expiration);
                /*       */
            }
            /*       */
        });
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void changeSkillsLevel(Map<Integer, SkillEntry> skills) {
        /*  6417 */
        if (skills.isEmpty()) {
            /*       */
            return;
            /*       */
        }
        /*  6420 */
        Map<Integer, SkillEntry> list = new HashMap<>();
        /*  6421 */
        boolean hasRecovery = false, recalculate = false;
        /*  6422 */
        for (Map.Entry<Integer, SkillEntry> data : skills.entrySet()) {
            /*  6423 */
            Skill skill = SkillFactory.getSkill(((Integer) data.getKey()).intValue());
            /*  6424 */
            if (changeSkillData(skill, ((SkillEntry) data.getValue()).skillevel, ((SkillEntry) data.getValue()).masterlevel, ((SkillEntry) data.getValue()).expiration)) {
                /*  6425 */
                list.put(data.getKey(), data.getValue());
                /*  6426 */
                if (SkillConstants.isRecoveryIncSkill(((Integer) data.getKey()).intValue())) {
                    /*  6427 */
                    hasRecovery = true;
                    /*       */
                }
                /*  6429 */
                if (((Integer) data.getKey()).intValue() < 80000000) {
                    /*  6430 */
                    recalculate = true;
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*  6434 */
        if (list.isEmpty()) {
            /*       */
            return;
            /*       */
        }
        /*  6437 */
        this.client.announce(MaplePacketCreator.updateSkills(list));
        /*  6438 */
        reUpdateStat(hasRecovery, recalculate);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    private void reUpdateStat(boolean hasRecovery, boolean recalculate) {
        /*  6445 */
        this.changed_skills = true;
        /*  6446 */
        if (hasRecovery) {
            /*  6447 */
            this.stats.relocHeal(this);
            /*       */
        }
        /*  6449 */
        if (recalculate) {
            /*  6450 */
            this.stats.recalcLocalStats(this);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean changeSkillData(Skill skill, int newLevel, byte newMasterlevel, long expiration) {
        /*  6458 */
        if (skill == null || (!SkillConstants.isApplicableSkill(skill.getId()) && !SkillConstants.isApplicableSkill_(skill.getId()))) {
            /*  6459 */
            return false;
            /*       */
        }
        /*  6461 */
        if (newLevel <= 0 && newMasterlevel <= 0) {
            /*  6462 */
            if (this.skills.containsKey(Integer.valueOf(skill.getId()))) {
                /*  6463 */
                this.skills.remove(Integer.valueOf(skill.getId()));
                /*       */
            } else {
                /*  6465 */
                return false;
                /*       */
            }
            /*       */
        } else {
            /*  6468 */
            this.skills.put(Integer.valueOf(skill.getId()), new SkillEntry(newLevel, newMasterlevel, expiration, getSkillTeachId(skill), getSkillPosition(skill)));
            /*       */
        }
        /*  6470 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    public void changeSkillLevel_Skip(Map<Integer, SkillEntry> skill) {
        /*  6474 */
        changeSkillLevel_Skip(skill, false);
        /*       */
    }

    /*       */
    /*       */
    public void changeSkillLevel_Skip(Map<Integer, SkillEntry> skill, boolean write) {
        /*  6478 */
        if (skill.isEmpty()) {
            /*       */
            return;
            /*       */
        }
        /*  6481 */
        Map<Integer, SkillEntry> newlist = new HashMap<>();
        /*  6482 */
        for (Map.Entry<Integer, SkillEntry> date : skill.entrySet()) {
            /*  6483 */
            if (date.getKey() == null) {
                /*       */
                continue;
                /*       */
            }
            /*       */
            /*  6487 */
            newlist.put(date.getKey(), date.getValue());
            /*  6488 */
            if (((SkillEntry) date.getValue()).skillevel == 0 && ((SkillEntry) date.getValue()).masterlevel == 0) {
                /*  6489 */
                if (this.skills.containsKey(date.getKey()))
                    /*  6490 */ this.skills.remove(date.getKey());
                /*       */
                continue;
                /*       */
            }
            /*  6493 */
            this.skills.put(date.getKey(), date.getValue());
            /*       */
        }
        /*       */
        /*  6496 */
        if (write && !newlist.isEmpty()) {
            /*  6497 */
            this.client.announce(MaplePacketCreator.updateSkills(newlist));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void changePetSkillLevel(Map<Integer, SkillEntry> skill) {
        /*  6502 */
        if (skill.isEmpty()) {
            /*       */
            return;
            /*       */
        }
        /*  6505 */
        Map<Integer, SkillEntry> newlist = new HashMap<>();
        /*  6506 */
        for (Map.Entry<Integer, SkillEntry> date : skill.entrySet()) {
            /*  6507 */
            if (date.getKey() == null) {
                /*       */
                continue;
                /*       */
            }
            /*       */
            /*  6511 */
            if (((SkillEntry) date.getValue()).skillevel == 0 && ((SkillEntry) date.getValue()).masterlevel == 0) {
                /*  6512 */
                if (this.skills.containsKey(date.getKey())) {
                    /*  6513 */
                    this.skills.remove(date.getKey());
                    /*  6514 */
                    newlist.put(date.getKey(), date.getValue());
                    /*       */
                }
                continue;
                /*  6516 */
            }
            if (getSkillLevel(((Integer) date.getKey()).intValue()) != ((SkillEntry) date.getValue()).skillevel) {
                /*  6517 */
                this.skills.put(date.getKey(), date.getValue());
                /*  6518 */
                newlist.put(date.getKey(), date.getValue());
                /*       */
            }
            /*       */
        }
        /*  6521 */
        if (!newlist.isEmpty()) {
            /*  6522 */
            for (Map.Entry<Integer, SkillEntry> date : newlist.entrySet()) {
                /*  6523 */
                this.client.announce(MaplePacketCreator.updatePetSkill(((Integer) date.getKey()).intValue(), ((SkillEntry) date.getValue()).skillevel, ((SkillEntry) date.getValue()).masterlevel, ((SkillEntry) date.getValue()).expiration));
                /*       */
            }
            /*  6525 */
            reUpdateStat(false, true);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void changeTeachSkill(int skillid, int teachid, int skillevel, boolean delete) {
        /*  6530 */
        Skill skill = SkillFactory.getSkill(skillid);
        /*  6531 */
        if (skill == null) {
            /*       */
            return;
            /*       */
        }
        /*  6534 */
        if (delete) {
            /*  6535 */
            HashMap<Integer, Integer> hashMap = new HashMap<>();
            /*  6536 */
            hashMap.put(Integer.valueOf(skillid), Integer.valueOf(teachid));
            /*  6537 */
            this.skills.remove(Integer.valueOf(skillid));
            /*  6538 */
            this.linkSkills.remove(Integer.valueOf(skillid));
            /*  6539 */
            if (skillid == 80000055 || skillid == 80000329) {
                /*  6540 */
                int[] arrn = SkillConstants.gm(skillid);
                /*  6541 */
                if (arrn != null) {
                    /*  6542 */
                    for (int id : arrn) {
                        /*  6543 */
                        Skill skill1 = SkillFactory.getSkill(id);
                        /*  6544 */
                        SkillEntry se = this.linkSkills.remove(Integer.valueOf(id));
                        /*  6545 */
                        this.skills.remove(Integer.valueOf(id));
                        /*  6546 */
                        if (skill1 != null && se != null) {
                            /*  6547 */
                            hashMap.put(Integer.valueOf(id), Integer.valueOf(se.teachId));
                            /*  6548 */
                            ((SkillEntry) ((Pair) this.sonOfLinkedSkills.get(Integer.valueOf(id))).getRight()).teachId = se.teachId;
                            /*  6549 */
                            try (DruidPooledConnection conn = DatabaseConnection.getInstance().getConnection();
                                    /*  6550 */                   PreparedStatement ps = conn.prepareStatement("UPDATE skills SET teachId = ? WHERE skillid = ? AND characterid = ?")) {
                                /*  6551 */
                                int n6 = 0;
                                /*  6552 */
                                ps.setInt(++n6, 0);
                                /*  6553 */
                                ps.setInt(++n6, SkillConstants.go(id));
                                /*  6554 */
                                ps.setInt(++n6, se.teachId);
                                /*  6555 */
                                ps.executeUpdate();
                                /*       */
                            }
                            /*  6557 */ catch (SQLException e) {
                                /*  6558 */
                                log.error("传授技能失败 - changeTeachSkill", e);
                                /*       */
                            }
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
            } else {
                /*  6564 */
                ((SkillEntry) ((Pair) this.sonOfLinkedSkills.get(Integer.valueOf(skillid))).getRight()).teachId = teachid;
                /*       */
            }
            /*  6566 */
            send(MaplePacketCreator.DeleteLinkSkillResult(hashMap));
            /*       */
        } else {
            /*  6568 */
            int gn = SkillConstants.gn(skillid);
            /*  6569 */
            if (gn > 0) {
                /*  6570 */
                Skill skill1 = SkillFactory.getSkill(gn);
                /*  6571 */
                SkillEntry se = this.skills.get(Integer.valueOf(skillid));
                /*  6572 */
                if (skill1 != null && se == null) {
                    /*  6573 */
                    this.skills.put(Integer.valueOf(skillid), new SkillEntry(skillevel, (byte) skill1.getMasterLevel(), System.currentTimeMillis(), teachid));
                    /*       */
                } else {
                    /*  6575 */
                    ((SkillEntry) this.skills.get(Integer.valueOf(skillid))).skillevel += skillevel;
                    /*       */
                }
                /*       */
            }
            /*  6578 */
            this.skills.put(Integer.valueOf(skillid), new SkillEntry(skillevel, (byte) skill.getMasterLevel(), System.currentTimeMillis(), teachid));
            /*  6579 */
            this.linkSkills.put(Integer.valueOf(skillid), new SkillEntry(skillevel, (byte) skill.getMasterLevel(), System.currentTimeMillis(), teachid));
            /*  6580 */
            ((SkillEntry) ((Pair) this.sonOfLinkedSkills.get(Integer.valueOf(skillid))).getRight()).teachId = this.id;
            /*  6581 */
            ((SkillEntry) ((Pair) this.sonOfLinkedSkills.get(Integer.valueOf(skillid))).getRight()).expiration = System.currentTimeMillis();
            /*       */
        }
        /*  6583 */
        this.changed_skills = true;
        /*       */
    }

    /*       */
    /*       */
    public void changeTeachSkill(int skillId, int toChrId) {
        /*  6587 */
        SkillEntry ret = getSkillEntry(skillId);
        /*  6588 */
        if (ret != null) {
            /*  6589 */
            ret.teachId = toChrId;
            /*  6590 */
            this.client.announce(MaplePacketCreator.updateSkill(skillId, toChrId, ret.masterlevel, ret.expiration));
            /*  6591 */
            this.changed_skills = true;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void playerDead() {
        /*  6596 */
        MapleBuffStat[] stats = {MapleBuffStat.灵魂之石, MapleBuffStat.天堂之门, MapleBuffStat.神秘的运气, MapleBuffStat.九死一生, MapleBuffStat.火凤凰};
        /*  6597 */
        for (MapleBuffStat stat : stats) {
            /*  6598 */
            MapleStatEffect effect = getStatForBuff(stat);
            /*  6599 */
            if (effect != null && !skillisCooling(effect.getSourceid())) {
                /*  6600 */
                int cooldown, x = (effect.getX() <= 0) ? 100 : effect.getX();
                /*  6601 */
                switch (stat) {
//                    /*       */
//                    case 没有武器:
//                        /*  6603 */
//                        x = effect.getY();
//                        /*  6604 */
//                        handle无敌(effect, 3000);
//                        /*       */
//                        /*       */
//                        /*       */
//                    case 单手剑:
//                        /*  6608 */
//                        x = 100;
//                        /*       */
//                        /*       */
//                        /*       */
//                    case 双手剑:
//                        /*  6612 */
//                        if (effect.makeChanceResult(this)) ;
//                        /*       */
//                        break;
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    default:
                        /*  6618 */
                        cooldown = effect.getCooldown(this);
                        /*  6619 */
                        if (stat == MapleBuffStat.灵魂之石) {
                            /*  6620 */
                            send(EffectPacket.showSpecialEffect(EffectOpcode.UserEffect_SoulStoneUse.getValue()));
                            /*       */
                        } else {
                            /*  6622 */
                            dropMessage(5, "由于" + effect.getName() + "的效果发动，无视本次死亡。");
                            /*       */
                        }
                        /*  6624 */
                        getStat().setHp(getStat().getCurrentMaxHp() * x / 100, this);
                        /*  6625 */
                        setStance(0);
                        /*  6626 */
                        dispelDebuffs();
                        /*  6627 */
                        cancelAllDebuffs();
                        /*  6628 */
                        dispelSkill(effect.getSourceid());
                        /*  6629 */
                        updateSingleStat(MapleStat.HP, getStat().getHp());
                        /*  6630 */
                        updateSingleStat(MapleStat.MP, getStat().getMp());
                        /*  6631 */
                        if (cooldown > 0 && !skillisCooling(effect.getSourceid())) {
                            /*  6632 */
                            addCooldown(effect.getSourceid(), System.currentTimeMillis(), (cooldown * 1000));
                            /*       */
                        }
                        /*  6634 */
                        if (effect.getSourceid() == 14110030) {
                            /*  6635 */
                            effect.applyTo(this, true);
                            /*  6636 */
                            handle无敌(effect, 5000);
                            /*  6637 */
                            send(EffectPacket.showEffect(getId(), effect.getSourceid(), EffectOpcode.UserEffect_SkillPreLoopEnd.getValue(), 3000, false));
                            /*  6638 */
                            send_other(EffectPacket.showEffect(getId(), effect.getSourceid(), EffectOpcode.UserEffect_SkillPreLoopEnd.getValue(), 3000, true), false);
                            /*       */
                        }
                        /*       */
                        return;
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
            }
            /*       */
        }
        /*  6658 */
        if (getSkillLevel(1320016) > 0 && !skillisCooling(1320019)) {
            /*  6659 */
            getStat().setHp(getStat().getCurrentMaxHp(), this);
            /*  6660 */
            getStat().setMp(getStat().getCurrentMaxMp(getJob()), this);
            /*  6661 */
            updateSingleStat(MapleStat.HP, getStat().getHp());
            /*  6662 */
            updateSingleStat(MapleStat.MP, getStat().getMp());
            /*  6663 */
            setStance(0);
            /*  6664 */
            Skill skill = SkillFactory.getSkill(1320019);
            /*  6665 */
            skill.getEffect(getSkillLevel(1320016)).applyTo(this);
            /*       */
            return;
            /*       */
        }
        /*  6668 */
        MapleStatEffect statss = getStatForBuff(MapleBuffStat.天堂之门);
        /*  6669 */
        if (statss != null) {
            /*  6670 */
            getStat().setHp(getStat().getCurrentMaxHp(), this);
            /*  6671 */
            getStat().setMp(getStat().getCurrentMaxMp(getJob()), this);
            /*  6672 */
            updateSingleStat(MapleStat.HP, getStat().getHp());
            /*  6673 */
            updateSingleStat(MapleStat.MP, getStat().getMp());
            /*  6674 */
            cancelEffectFromBuffStat(MapleBuffStat.天堂之门);
            /*       */
            return;
            /*       */
        }
        /*  6677 */
        cancelEffectFromBuffStat(MapleBuffStat.影分身);
        /*  6678 */
        cancelEffectFromBuffStat(MapleBuffStat.变身效果);
        /*  6679 */
        cancelEffectFromBuffStat(MapleBuffStat.飞翔);
        /*  6680 */
        cancelEffectFromBuffStat(MapleBuffStat.骑兽技能);
        /*  6681 */
        cancelEffectFromBuffStat(MapleBuffStat.金属机甲);
        /*  6682 */
        cancelEffectFromBuffStat(MapleBuffStat.恢复效果);
        /*  6683 */
        cancelEffectFromBuffStat(MapleBuffStat.增加最大HP);
        /*  6684 */
        cancelEffectFromBuffStat(MapleBuffStat.增加最大MP);
        /*  6685 */
        cancelEffectFromBuffStat(MapleBuffStat.增强_MAXHP);
        /*  6686 */
        cancelEffectFromBuffStat(MapleBuffStat.增强_MAXMP);
        /*  6687 */
        cancelEffectFromBuffStat(MapleBuffStat.MAXHP);
        /*  6688 */
        cancelEffectFromBuffStat(MapleBuffStat.MAXMP);
        /*  6689 */
        cancelEffectFromBuffStat(MapleBuffStat.精神连接);
        /*  6690 */
        cancelEffectFromBuffStat(MapleBuffStat.剑刃之壁);
        /*  6691 */
        cancelEffectFromBuffStat(MapleBuffStat.飞行骑乘);
        /*  6692 */
        cancelEffectFromBuffStat(MapleBuffStat.击杀点数);
        /*  6693 */
        dispelSummons();
        /*  6694 */
        checkFollow();
        /*  6695 */
        if (getEventInstance() != null) {
            /*  6696 */
            getEventInstance().playerKilled(this);
            /*       */
        }
        /*  6698 */
        setPowerCount(0);
        /*  6699 */
        this.specialStats.resetSpecialStats();
        /*  6700 */
        if (!JobConstants.is新手职业(this.job) && !inPVP()) {
            /*  6701 */
            int charms = getItemQuantity(5130000, false);
            /*  6702 */
            if (charms > 0) {
                /*  6703 */
                MapleInventoryManipulator.removeById(this.client, MapleInventoryType.CASH, 5130000, 1, true, false);
                /*  6704 */
                charms--;
                /*  6705 */
                if (charms > 255) {
                    /*  6706 */
                    charms = 255;
                    /*       */
                }
                /*  6708 */
                this.client.announce(MTSCSPacket.INSTANCE.useCharm((byte) charms, (byte) 0));
                /*       */
            } else {
                /*       */
                float diepercentage;
                /*  6711 */
                long expforlevel = getExpNeededForLevel();
                /*  6712 */
                if (this.map.isTown() || FieldLimitType.RegularExpLoss.check(this.map.getFieldLimit())) {
                    /*  6713 */
                    diepercentage = 0.01F;
                    /*       */
                } else {
                    /*  6715 */
                    diepercentage = 0.1F - (((MapleTrait) this.traits.get(MapleTraitType.charisma)).getLevel() / 20) / 100.0F;
                    /*       */
                }
                /*  6717 */
                long v10 = this.exp.get() - (long) (expforlevel * diepercentage);
                /*  6718 */
                if (v10 < 0L) {
                    /*  6719 */
                    v10 = 0L;
                    /*       */
                }
                /*  6721 */
                this.exp.set(v10);
                /*       */
            }
            /*  6723 */
            updateSingleStat(MapleStat.经验, this.exp.get());
            /*       */
        }
        /*  6725 */
        if (!getStat().checkEquipDurabilitys(this, -100)) {
            /*  6726 */
            dropMessage(5, "An item has run out of durability but has no inventory room to go to.");
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*  6736 */
        playerDeadResponse();
        /*  6737 */
        if (this.pyramidSubway != null) {
            /*  6738 */
            getStat().setHp(50, this);
            /*  6739 */
            this.pyramidSubway.fail(this);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void playerDeadResponse() {
        /*  6753 */
        int type = 1;
        /*  6754 */
        int value = 0;
        /*  6755 */
        if (getItemQuantity(5133000) > 0) {
            /*  6756 */
            type |= 0x2;
            /*       */
        }
        /*  6758 */
        if (getEventInstance() != null && getReviveCount() >= 0) {
            /*  6759 */
            value = 4;
            /*  6760 */
            EventDeathEffect();
            /*       */
            /*       */
        }
        /*  6763 */
        else if (getReviveCount() < 0) {
            /*  6764 */
            if (getItemQuantity(5510000) > 0) {
                /*  6765 */
                value = 6;
                /*  6766 */
            } else if (getItemQuantity(5511001) > 0) {
                /*  6767 */
                value = 12;
                /*       */
            }
            /*       */
        }
        /*       */
        /*  6771 */
        this.client.announce(EffectPacket.playerDeadConfirm(type, value));
        /*       */
    }

    /*       */
    /*       */
    public void playerDeadReviveEffect(int oneProgressBartime, int towProgressBartime) {
        /*  6775 */
        this.client.announce(EffectPacket.getReviveEffect(oneProgressBartime, towProgressBartime));
        /*       */
    }

    /*       */
    /*       */
    public void updatePartyMemberHP() {
        /*  6779 */
        if (this.party != null && this.client.getChannelServer() != null) {
            /*  6780 */
            int channel = this.client.getChannel();
            /*  6781 */
            for (MaplePartyCharacter partychar : this.party.getMembers()) {
                /*  6782 */
                if (partychar != null && partychar.getMapid() == getMapId() && partychar.getChannel() == channel) {
                    /*  6783 */
                    MapleCharacter other = this.client.getChannelServer().getPlayerStorage().getCharacterByName(partychar.getName());
                    /*  6784 */
                    if (other != null) {
                        /*  6785 */
                        other.getClient().announce(PartyPacket.updatePartyMemberHP(getId(), this.stats.getHp(), this.stats.getCurrentMaxHp()));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void receivePartyMemberHP() {
        /*  6793 */
        if (this.party == null) {
            /*       */
            return;
            /*       */
        }
        /*  6796 */
        int channel = this.client.getChannel();
        /*  6797 */
        for (MaplePartyCharacter partychar : this.party.getMembers()) {
            /*  6798 */
            if (partychar != null && partychar.getMapid() == getMapId() && partychar.getChannel() == channel) {
                /*  6799 */
                MapleCharacter other = this.client.getChannelServer().getPlayerStorage().getCharacterByName(partychar.getName());
                /*  6800 */
                if (other != null) {
                    /*  6801 */
                    this.client.announce(PartyPacket.updatePartyMemberHP(other.getId(), other.getStat().getHp(), other.getStat().getCurrentMaxHp()));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void heal() {
        /*  6808 */
        this.stats.heal(this);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void healHP(int delta) {
        /*  6817 */
        addHP(delta);
        /*  6818 */
        this.client.announce(EffectPacket.showOwnHpHealed(delta));
        /*  6819 */
        getMap().broadcastMessage(this, EffectPacket.showHpHealed(getId(), delta), false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void healMP(int delta) {
        /*  6828 */
        addMP(delta);
        /*  6829 */
        this.client.announce(EffectPacket.showOwnHpHealed(delta));
        /*  6830 */
        getMap().broadcastMessage(this, EffectPacket.showHpHealed(getId(), delta), false);
        /*       */
    }

    /*       */
    /*       */
    public void healHPMP(int deltahp, int deltamp) {
        /*  6834 */
        addHPMP(deltahp, deltamp);
        /*  6835 */
        send(EffectPacket.showOwnHpHealed((deltahp != 0) ? deltahp : deltamp));
        /*  6836 */
        getMap().broadcastMessage(this, EffectPacket.showHpHealed_Other(getId(), (deltahp != 0) ? deltahp : deltamp), false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addHP(int delta) {
        /*  6846 */
        if (this.stats.setHp(this.stats.getHp() + delta, this)) {
            /*  6847 */
            updateSingleStat(MapleStat.HP, this.stats.getHp());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addMP(int delta) {
        /*  6858 */
        addMP(delta, false);
        /*       */
    }

    /*       */
    /*       */
    public void addMP(int delta, boolean ignore) {
        /*  6862 */
        if (JobConstants.isNotMpJob(getJob()) && GameConstants.getMPByJob(getJob()) <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  6865 */
        if (((delta < 0 && JobConstants.is恶魔猎手(getJob())) || !JobConstants.is恶魔猎手(getJob()) || ignore) &&
                /*  6866 */       this.stats.setMp(this.stats.getMp() + delta, this)) {
            /*  6867 */
            updateSingleStat(MapleStat.MP, this.stats.getMp());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void addDemonMp(int delta) {
        /*  6873 */
        if (delta > 0 && (getJob() == 3111 || getJob() == 3112) &&
                /*  6874 */       this.stats.setMp(this.stats.getMp() + delta, this)) {
            /*  6875 */
            updateSingleStat(MapleStat.MP, this.stats.getMp());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void addHPMP(int hpDiff, int mpDiff) {
        /*  6881 */
        this.addhpmpLock.writeLock().lock();
        /*       */
        try {
            /*  6883 */
            List<Pair<MapleStat, Long>> statups = new ArrayList<>();
            /*  6884 */
            int alpha = Math.min(getStat().getCurrentMaxHp(), this.stats.getHp() + hpDiff);
            /*  6885 */
            int beta = Math.min(getStat().getCurrentMaxMp(getJob()), this.stats.getMp() + mpDiff);
            /*  6886 */
            if (this.stats.setHp(alpha, this)) {
                /*  6887 */
                if (this.stats.getHp() <= 0) {
                    /*  6888 */
                    statups.add(new Pair(MapleStat.HP, Long.valueOf(this.stats.getHp())));
                    /*  6889 */
                    statups.add(new Pair(MapleStat.经验, Long.valueOf(getExp())));
                    /*       */
                } else {
                    /*       */
                    /*  6892 */
                    statups.add(new Pair(MapleStat.HP, Long.valueOf(this.stats.getHp())));
                    /*       */
                }
                /*       */
            }
            /*       */
            /*  6896 */
            if (((mpDiff < 0 && JobConstants.is恶魔猎手(getJob())) || !JobConstants.is恶魔猎手(getJob())) &&
                    /*  6897 */         this.stats.setMp(beta, this)) {
                /*  6898 */
                statups.add(new Pair(MapleStat.MP, Long.valueOf(this.stats.getMp())));
                /*       */
            }
            /*       */
            /*  6901 */
            if (statups.size() > 0) {
                /*  6902 */
                this.client.announce(MaplePacketCreator.updatePlayerStats(statups, this));
                /*       */
                /*       */
            }
            /*       */
        }
        /*       */ finally {
            /*       */
            /*  6908 */
            this.addhpmpLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void addHPMP(int hpDiff, int mpDiff, boolean itemReaction, boolean broadcast) {
        /*  6913 */
        this.addhpmpLock.writeLock().lock();
        /*       */
        try {
            /*  6915 */
            if (isAlive()) {
                /*  6916 */
                boolean isChangeHP = this.stats.setHp(Math.min(getStat().getCurrentMaxHp(), this.stats.getHp() + hpDiff), this);
                /*  6917 */
                this.stats.setMp(Math.min(getStat().getCurrentMaxMp(getJob()), this.stats.getMp() + mpDiff), this);
                /*  6918 */
                updateSingleStat(MapleStat.HP, this.stats.getHp());
                /*  6919 */
                updateSingleStat(MapleStat.MP, this.stats.getMp());
                /*  6920 */
                if (this.party != null) {
                    /*  6921 */
                    updatePartyMemberHP();
                    /*       */
                }
                /*  6923 */
                if (isChangeHP && broadcast && this.client != null && this.map != null) {
                    /*  6924 */
                    this.client.announce(EffectPacket.showHpHealed(-1, hpDiff));
                    /*  6925 */
                    this.map.broadcastMessage(this, EffectPacket.showHpHealed(getId(), hpDiff), getPosition());
                    /*       */
                }
                /*  6927 */
                if (!isAlive()) {
                    /*  6928 */
                    playerDead();
                    /*       */
                }
                /*       */
            }
            /*       */
        } finally {
            /*  6932 */
            this.addhpmpLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateSingleStat(MapleStat stat, long newval) {
        /*  6945 */
        updateSingleStat(stat, newval, false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateSingleStat(MapleStat stat, long newval, boolean itemReaction) {
        /*  6958 */
        Pair<MapleStat, Long> statpair = new Pair(stat, Long.valueOf(newval));
        /*  6959 */
        this.client.announce(MaplePacketCreator.updatePlayerStats(Collections.singletonList(statpair), itemReaction, this));
        /*       */
    }

    /*       */
    /*       */
    public void gainExp(long total, boolean show, boolean inChat, boolean white) {
        /*  6963 */
        if (ServerConfig.WORLD_BANGAINEXP) {
            /*  6964 */
            dropMessage(6, "管理员禁止了经验获取。");
            /*       */
            return;
            /*       */
        }
        /*       */
        try {
            /*  6968 */
            long prevexp = getExp();
            /*  6969 */
            long needed = getExpNeededForLevel();
            /*  6970 */
            if (total > 0L) {
                /*  6971 */
                this.stats.checkEquipLevels(this, total);
                /*  6972 */
                this.stats.checkEquipSealed(this, total);
                /*       */
            }
            /*  6974 */
            if (this.level >= getMaxLevelForSever()) {
                /*  6975 */
                setExp(0L);
                /*  6976 */
            } else if (ServerConfig.WORLD_APPENDEXP) {
                /*  6977 */
                additionExpAndLevelUp(total);
                /*       */
            } else {
                /*  6979 */
                boolean leveled = false;
                /*  6980 */
                long tot = this.exp.get() + total;
                /*  6981 */
                if (tot >= needed) {
                    /*  6982 */
                    this.exp.addAndGet(total);
                    /*  6983 */
                    levelUp();
                    /*  6984 */
                    leveled = true;
                    /*  6985 */
                    if (this.level >= getMaxLevelForSever()) {
                        /*  6986 */
                        setExp(0L);
                        /*       */
                    } else {
                        /*  6988 */
                        needed = getExpNeededForLevel();
                        /*  6989 */
                        if (this.exp.get() >= needed) {
                            /*  6990 */
                            setExp(needed - 1L);
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                } else {
                    /*  6994 */
                    this.exp.addAndGet(total);
                    /*       */
                }
                /*  6996 */
                if (total > 0L) {
                    /*  6997 */
                    familyRep((int) prevexp, (int) needed, leveled);
                    /*       */
                }
                /*       */
            }
            /*  7000 */
            if (total != 0L) {
                /*  7001 */
                if (this.exp.get() < 0L) {
                    /*  7002 */
                    if (total > 0L) {
                        /*  7003 */
                        setExp(needed);
                        /*       */
                    } else {
                        /*  7005 */
                        setExp(0L);
                        /*       */
                    }
                    /*       */
                }
                /*  7008 */
                updateSingleStat(MapleStat.经验, getExp());
                /*  7009 */
                if (show) {
                    /*  7010 */
                    this.client.announce(MaplePacketCreator.GainEXP_Others(total, inChat, white));
                    /*       */
                }
                /*       */
            }
            /*  7013 */
        } catch (Exception e) {
            /*  7014 */
            log.error("获得经验错误", e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void familyRep(int prevexp, int needed, boolean leveled) {
        /*  7019 */
        if (this.mfc != null) {
            /*  7020 */
            int onepercent = needed / 100;
            /*  7021 */
            if (onepercent <= 0) {
                /*       */
                return;
                /*       */
            }
            /*  7024 */
            int percentrep = (int) (getExp() / onepercent - (prevexp / onepercent));
            /*  7025 */
            if (leveled) {
                /*  7026 */
                percentrep = 100 - percentrep + this.level / 2;
                /*       */
            }
            /*  7028 */
            if (percentrep > 0) {
                /*  7029 */
                int sensen = WorldFamilyService.getInstance().setRep(this.mfc.getFamilyId(), this.mfc.getSeniorId(), percentrep * 10, this.level, this.name);
                /*  7030 */
                if (sensen > 0) {
                    /*  7031 */
                    WorldFamilyService.getInstance().setRep(this.mfc.getFamilyId(), sensen, percentrep * 5, this.level, this.name);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void monsterMultiKill() {
        /*  7038 */
        if (this.killmonsterExps.size() > 2) {
            /*  7039 */
            long multiKillExp = 0L;
            /*  7040 */
            for (Iterator<Long> iterator = this.killmonsterExps.iterator(); iterator.hasNext(); ) {
                long exps = ((Long) iterator.next()).longValue();
                /*  7041 */
                multiKillExp += (long) Math.ceil((exps * (Math.min(this.monsterCombo, 60) + 1)) * 0.5D / 100.0D);
            }
            /*       */
            /*  7043 */
            gainExp((int) multiKillExp, false, false, false);
            /*       */
        }
        /*  7045 */
        this.killmonsterExps.clear();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainExpMonster(long gain, boolean show, boolean white, int numExpSharers, boolean partyBonusMob, int partyBonusRate) {
        /*  7062 */
        if (ServerConfig.WORLD_BANGAINEXP) {
            /*  7063 */
            dropMessage(6, "管理员禁止了经验获取。");
            /*       */
            return;
            /*       */
        }
        /*  7066 */
        long totalExp = gain;
        /*  7067 */
        int 网吧经验 = 0;
        /*  7068 */
        if (haveItem(5420008)) {
            /*  7069 */
            网吧经验 = (int) (gain / 100.0D * 25.0D);
            /*  7070 */
            totalExp += 网吧经验;
            /*       */
        }
        /*  7072 */
        int 精灵祝福 = 0;
        /*  7073 */
        if (get精灵祝福() > 0) {
            /*  7074 */
            精灵祝福 = (int) (gain / 100.0D * 10.0D);
            /*  7075 */
            totalExp += 精灵祝福;
            /*       */
        }
        /*  7077 */
        int 结婚经验 = 0;
        /*  7078 */
        if (this.marriageId > 0) {
            /*  7079 */
            MapleCharacter marrChr = this.map.getCharacterById(this.marriageId);
            /*  7080 */
            if (marrChr != null) {
                /*  7081 */
                结婚经验 = (int) (gain / 100.0D * 10.0D);
                /*  7082 */
                totalExp += 结婚经验;
                /*       */
            }
            /*       */
        }
        /*  7085 */
        int 组队经验 = 0;
        /*  7086 */
        if (numExpSharers > 1) {
            /*  7087 */
            double rate = (partyBonusRate > 0) ? (partyBonusRate / 100.0D) : ((this.map == null || !partyBonusMob || this.map.getPartyBonusRate() <= 0) ? 0.05D : (this.map.getPartyBonusRate() / 100.0D));
            /*  7088 */
            组队经验 = (int) ((float) (gain * rate) * (numExpSharers + ((rate > 0.05D) ? -1 : 1)));
            /*  7089 */
            totalExp += 组队经验;
            /*       */
        }
        /*       */
        /*  7092 */
        long combokillExp = 0L;
        /*  7093 */
        if (this.killmonsterExps.isEmpty()) {
            /*  7094 */
            if (this.monsterCombo > 0 && System.currentTimeMillis() - this.lastmonsterCombo > 7000L) {
                /*  7095 */
                this.monsterCombo = 0;
                /*       */
            }
            /*  7097 */
            this.monsterCombo += (this.monsterCombo == 999) ? 0 : 1;
            /*  7098 */
            this.lastmonsterCombo = System.currentTimeMillis();
            /*       */
        }
        /*  7100 */
        if (this.monsterCombo > 1) {
            /*  7101 */
            combokillExp += (long) Math.ceil((gain * Math.min(this.monsterCombo, 60)) * 0.5D / 100.0D);
            /*       */
        }
        /*  7103 */
        totalExp += combokillExp;
        /*       */
        /*  7105 */
        int 道具佩戴经验 = 0;
        /*  7106 */
        int 召回戒指经验 = 0;
        /*  7107 */
        if (this.stats.equippedWelcomeBackRing) {
            /*  7108 */
            召回戒指经验 = (int) (gain / 100.0D * 80.0D);
            /*  7109 */
            totalExp += 召回戒指经验;
            /*       */
        }
        /*  7111 */
        if (this.stats.equippedFairy > 0) {
            /*  7112 */
            道具佩戴经验 = (int) (gain / 100.0D * this.stats.equippedFairy);
            /*  7113 */
            totalExp += 道具佩戴经验;
            /*       */
        }
        /*  7115 */
        if (gain > 0L && totalExp < gain) {
            /*  7116 */
            totalExp = 2147483647L;
            /*       */
        }
        /*  7118 */
        if (totalExp > 0L) {
            /*  7119 */
            this.stats.checkEquipLevels(this, totalExp);
            /*  7120 */
            gainBeastTamerSkillExp((int) totalExp);
            /*  7121 */
            this.stats.checkEquipSealed(this, totalExp);
            /*       */
        }
        /*  7123 */
        long prevexp = getExp();
        /*  7124 */
        long needed = getExpNeededForLevel();
        /*  7125 */
        if (this.level >= getMaxLevelForSever()) {
            /*  7126 */
            setExp(0L);
            /*  7127 */
        } else if (ServerConfig.WORLD_APPENDEXP) {
            /*  7128 */
            additionExpAndLevelUp(totalExp);
            /*       */
        } else {
            /*  7130 */
            boolean leveled = false;
            /*  7131 */
            if (this.exp.get() + totalExp >= needed || this.exp.get() >= needed) {
                /*  7132 */
                this.exp.addAndGet(totalExp);
                /*  7133 */
                levelUp();
                /*  7134 */
                leveled = true;
                /*  7135 */
                if (this.level >= getMaxLevelForSever()) {
                    /*  7136 */
                    setExp(0L);
                    /*       */
                } else {
                    /*  7138 */
                    needed = getExpNeededForLevel();
                    /*  7139 */
                    if (this.exp.get() >= needed) {
                        /*  7140 */
                        setExp(needed);
                        /*       */
                    }
                    /*       */
                }
                /*       */
            } else {
                /*  7144 */
                this.exp.addAndGet(totalExp);
                /*       */
            }
            /*  7146 */
            if (totalExp > 0L) {
                /*  7147 */
                familyRep((int) prevexp, (int) needed, leveled);
                /*       */
            }
            /*       */
        }
        /*  7150 */
        if (gain != 0L) {
            /*  7151 */
            if (this.exp.get() < 0L) {
                /*  7152 */
                if (gain > 0L) {
                    /*  7153 */
                    setExp(getExpNeededForLevel());
                    /*  7154 */
                } else if (gain < 0L) {
                    /*  7155 */
                    setExp(0L);
                    /*       */
                }
                /*       */
            }
            /*  7158 */
            updateSingleStat(MapleStat.经验, getExp());
            /*  7159 */
            if (show) {
                /*  7160 */
                Map<MapleExpStat, Integer> expStatup = new EnumMap<>(MapleExpStat.class);
                /*  7161 */
                if (组队经验 > 0) {
                    /*  7162 */
                    expStatup.put(MapleExpStat.组队经验, Integer.valueOf(组队经验));
                    /*       */
                }
                /*  7164 */
                if (结婚经验 > 0) {
                    /*  7165 */
                    expStatup.put(MapleExpStat.结婚奖励经验, Integer.valueOf(结婚经验));
                    /*       */
                }
                /*  7167 */
                if (道具佩戴经验 > 0) {
                    /*  7168 */
                    expStatup.put(MapleExpStat.道具佩戴经验, Integer.valueOf(道具佩戴经验));
                    /*       */
                }
                /*  7170 */
                if (网吧经验 > 0) {
                    /*  7171 */
                    expStatup.put(MapleExpStat.网吧特别经验, Integer.valueOf(网吧经验));
                    /*       */
                }
                /*  7173 */
                if (精灵祝福 > 0) {
                    /*  7174 */
                    expStatup.put(MapleExpStat.精灵祝福经验, Integer.valueOf(精灵祝福));
                    /*       */
                }
                /*  7176 */
                if (召回戒指经验 > 0) {
                    /*  7177 */
                    expStatup.put(MapleExpStat.道具佩戴经验, Integer.valueOf(召回戒指经验));
                    /*       */
                }
                /*  7179 */
                this.client.announce(MaplePacketCreator.showGainExpFromMonster((int) gain, white, expStatup));
                /*       */
            }
            /*       */
        }
        /*  7182 */
        this.killmonsterExps.add(Long.valueOf(gain));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    private void additionExpAndLevelUp(long temptotal) {
        /*  7189 */
        while (this.level < getMaxLevelForSever()) {
            /*       */
            /*       */
            /*  7192 */
            long add = Math.min(temptotal, getExpNeededForLevel() - getExp());
            /*  7193 */
            this.exp.addAndGet(add);
            /*  7194 */
            if (this.exp.get() == getExpNeededForLevel()) {
                /*  7195 */
                int oldlevel = this.level;
                /*  7196 */
                levelUp();
                /*  7197 */
                if (oldlevel == this.level) {
                    /*       */
                    break;
                    /*       */
                }
                /*       */
            }
            /*  7201 */
            temptotal -= add;
            /*  7202 */
            if (temptotal <= 0L)
                /*       */ break;
            /*       */
        }
        /*       */
    }

    public void forceReAddItem_NoUpdate(Item item, MapleInventoryType type) {
        /*  7206 */
        getInventory(type).removeSlot(item.getPosition());
        /*  7207 */
        getInventory(type).addFromDB(item);
        /*       */
    }

    /*       */
    /*       */
    public void forceReAddItem(Item item, MapleInventoryType type) {
        /*  7211 */
        forceReAddItem_NoUpdate(item, type);
        /*  7212 */
        if (type != MapleInventoryType.UNDEFINED) {
            /*  7213 */
            this.client.announce(InventoryPacket.modifyInventory(false, Collections.singletonList(new ModifyInventory(0, item))));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void forceUpdateItem(Item item) {
        /*  7218 */
        forceUpdateItem(item, false);
        /*       */
    }

    /*       */
    /*       */
    public void petUpdateStats(MaplePet pet, boolean active) {
        /*  7222 */
        List<ModifyInventory> mods = new LinkedList<>();
        /*  7223 */
        Item Pet = getInventory(MapleInventoryType.CASH).getItem(pet.getInventoryPosition());
        /*  7224 */
        mods.add(new ModifyInventory(3, Pet));
        /*  7225 */
        mods.add(new ModifyInventory(0, Pet));
        /*  7226 */
        this.client.announce(InventoryPacket.modifyInventory(false, mods, this, active));
        /*       */
    }

    /*       */
    /*       */
    public void forceUpdateItem(Item item, boolean updateTick) {
        /*  7230 */
        List<ModifyInventory> mods = new LinkedList<>();
        /*  7231 */
        mods.add(new ModifyInventory(3, item));
        /*  7232 */
        mods.add(new ModifyInventory(0, item));
        /*  7233 */
        this.client.announce(InventoryPacket.modifyInventory(updateTick, mods, this));
        /*       */
    }

    /*       */
    /*       */
    public void silentPartyUpdate() {
        /*  7237 */
        if (this.party != null) {
            /*  7238 */
            WorldPartyService.getInstance().updateParty(this.party.getPartyId(), PartyOperation.更新队伍, new MaplePartyCharacter(this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean isSuperGM() {
        /*  7243 */
        return (this.gmLevel >= PlayerGMRank.SUPERGM.getLevel());
        /*       */
    }

    /*       */
    /*       */
    public boolean isIntern() {
        /*  7247 */
        return (this.gmLevel >= PlayerGMRank.INTERN.getLevel());
        /*       */
    }

    /*       */
    /*       */
    public boolean isGM() {
        /*  7251 */
        return (this.gmLevel >= PlayerGMRank.GM.getLevel());
        /*       */
    }

    /*       */
    /*       */
    public boolean isAdmin() {
        /*  7255 */
        return (this.gmLevel >= PlayerGMRank.ADMIN.getLevel());
        /*       */
    }

    /*       */
    /*       */
    public int getGMLevel() {
        /*  7259 */
        return this.gmLevel;
        /*       */
    }

    /*       */
    /*       */
    public boolean hasGmLevel(int level) {
        /*  7263 */
        return (this.gmLevel >= level);
        /*       */
    }

    /*       */
    /*       */
    public void setGmLevel(int level) {
        /*  7267 */
        this.gmLevel = (byte) level;
        /*  7268 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public boolean isShowPacket() {
        /*  7272 */
        return (isAdmin() && ServerConstants.isShowPacket());
        /*       */
    }

    /*       */
    /*       */
    public MapleInventory getInventory(MapleInventoryType type) {
        /*  7276 */
        return this.inventory[type.ordinal()];
        /*       */
    }

    /*       */
    /*       */
    public MapleInventory[] getInventorys() {
        /*  7280 */
        return this.inventory;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean canExpiration(long now) {
        /*  7287 */
        return (this.lastExpirationTime > 0L && this.lastExpirationTime + 60000L < now);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void expirationTask() {
        /*  7294 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /*  7295 */
        MapleQuestStatus stat = getQuestNoAdd(MapleQuest.getInstance(122700));
        /*       */
        /*  7297 */
        List<Integer> ret = new ArrayList<>();
        /*  7298 */
        long currenttimes = System.currentTimeMillis();
        /*  7299 */
        List<Triple<MapleInventoryType, Item, Boolean>> tobeRemoveItem = new ArrayList<>();
        /*  7300 */
        List<Item> tobeUnlockItem = new ArrayList<>();
        /*  7301 */
        this.rLCheck.lock();
        /*       */
        try {
            /*  7303 */
            for (MapleInventoryType inv : MapleInventoryType.values()) {
                /*  7304 */
                MapleInventory inventory = getInventory(inv);
                /*  7305 */
                for (Item item : inventory) {
                    /*  7306 */
                    long expiration = item.getExpiration();
                    /*  7307 */
                    if ((expiration != -1L && !ItemConstants.isPet(item.getItemId()) && currenttimes > expiration) || ii.isLogoutExpire(item.getItemId())) {
                        /*  7308 */
                        if (ItemFlag.封印.check(item.getFlag())) {
                            /*  7309 */
                            tobeUnlockItem.add(item);
                            continue;
                            /*  7310 */
                        }
                        if (currenttimes > expiration)
                            /*  7311 */ tobeRemoveItem.add(new Triple(inv, item, Boolean.valueOf(true)));
                        continue;
                        /*       */
                    }
                    /*  7313 */
                    if (item.getItemId() == 5000054 && item.getPet() != null && item.getPet().getSecondsLeft() <= 0) {
                        /*  7314 */
                        tobeRemoveItem.add(new Triple(inv, item, Boolean.valueOf(false)));
                        continue;
                        /*  7315 */
                    }
                    if (item.getPosition() == -38 && (
                            /*  7316 */             stat == null || stat.getCustomData() == null || Long.parseLong(stat.getCustomData()) < currenttimes)) {
                        /*  7317 */
                        tobeRemoveItem.add(new Triple(inv, item, Boolean.valueOf(false)));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        } finally {
            /*       */
            /*  7323 */
            this.rLCheck.unlock();
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*  7330 */
        for (Triple<MapleInventoryType, Item, Boolean> itemz : tobeRemoveItem) {
            /*  7331 */
            Item item = (Item) itemz.getMid();
            /*  7332 */
            if (item == null) {
                /*  7333 */
                log.error("道具到期", getName() + " 检测道具已经过期，但道具为空，无法继续执行。");
                /*       */
                continue;
                /*       */
            }
            /*  7336 */
            if (((Boolean) itemz.getRight()).booleanValue()) {
                /*  7337 */
                if (MapleInventoryManipulator.removeFromSlot(this.client, (MapleInventoryType) itemz.getLeft(), item.getPosition(), item.getQuantity(), false)) {
                    /*  7338 */
                    ret.add(Integer.valueOf(item.getItemId()));
                    /*       */
                }
                /*  7340 */
                if (itemz.getLeft() == MapleInventoryType.EQUIPPED)
                    /*  7341 */ equipChanged();
                continue;
                /*       */
            }
            /*  7343 */
            if (item.getPosition() == -38) {
                /*  7344 */
                short slot = getInventory(MapleInventoryType.EQUIP).getNextFreeSlot();
                /*  7345 */
                if (slot > -1) {
                    /*  7346 */
                    MapleInventoryManipulator.unequip(this.client, item.getPosition(), slot);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*  7350 */
        for (Item itemz : tobeUnlockItem) {
            /*  7351 */
            if (!itemz.getOwner().contains("复制")) {
                /*  7352 */
                itemz.setExpiration(-1L);
                /*  7353 */
                itemz.setFlag((short) (byte) (itemz.getFlag() - ItemFlag.封印.getValue()));
                /*  7354 */
                forceUpdateItem(itemz);
                /*  7355 */
                dropMessage(6, "封印道具[" + ii.getName(itemz.getItemId()) + "]封印时间已过期。");
                /*       */
            }
            /*       */
        }
        /*       */
        /*  7359 */
        this.pendingExpiration = ret;
        /*       */
        /*       */
        /*       */
        /*  7363 */
        List<Integer> tobeRemoveSkill = new ArrayList<>();
        /*  7364 */
        Map<Integer, SkillEntry> tobeRemoveList = new HashMap<>();
        /*  7365 */
        for (Map.Entry<Integer, SkillEntry> skil : this.skills.entrySet()) {
            /*  7366 */
            if (((SkillEntry) skil.getValue()).expiration != -1L && currenttimes > ((SkillEntry) skil.getValue()).expiration && !SkillConstants.isLinkSkills(((Integer) skil.getKey()).intValue()) && !SkillConstants.isTeachSkills(((Integer) skil.getKey()).intValue())) {
                /*  7367 */
                tobeRemoveSkill.add(skil.getKey());
                /*       */
            }
            /*       */
        }
        /*  7370 */
        for (Integer skil : tobeRemoveSkill) {
            /*  7371 */
            tobeRemoveList.put(skil, new SkillEntry(0, (byte) 0, -1L));
            /*  7372 */
            this.skills.remove(skil);
            /*  7373 */
            this.changed_skills = true;
            /*       */
        }
        /*  7375 */
        this.pendingSkills = tobeRemoveList;
        /*  7376 */
        if (stat != null && stat.getCustomData() != null && Long.parseLong(stat.getCustomData()) < currenttimes) {
            /*  7377 */
            this.quests.remove(Integer.valueOf(7830));
            /*  7378 */
            this.quests.remove(Integer.valueOf(122700));
            /*  7379 */
            this.client.announce(MaplePacketCreator.pendantSlot(false));
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  7384 */
        if (this.coreAura != null && currenttimes > this.coreAura.getExpiration()) {
            /*  7385 */
            this.coreAura.resetCoreAura();
            /*  7386 */
            this.coreAura.saveToDb(null);
            /*  7387 */
            updataCoreAura();
            /*  7388 */
            dropMessage(5, "宝盒属性时间到期，属性已经重置。");
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  7393 */
        Item itemFix = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -37);
        /*  7394 */
        if (itemFix != null && itemFix.getItemId() / 10000 != 119) {
            /*  7395 */
            short slot = getInventory(MapleInventoryType.EQUIP).getNextFreeSlot();
            /*  7396 */
            if (slot > -1) {
                /*  7397 */
                MapleInventoryManipulator.unequip(this.client, itemFix.getPosition(), slot);
                /*  7398 */
                dropMessage(5, "装备道具[" + ii.getName(itemFix.getItemId()) + "]由于装备的位置错误已自动取下。");
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  7404 */
        Timestamp currentVipTime = new Timestamp(System.currentTimeMillis());
        /*  7405 */
        if (getVip() != 0) {
            /*  7406 */
            Timestamp expirationVip = getViptime();
            /*  7407 */
            if (expirationVip != null && currentVipTime.after(expirationVip)) {
                /*  7408 */
                setVip(0);
                /*  7409 */
                setViptime((Timestamp) null);
                /*  7410 */
                dropMessage(-11, "您的Vip已经到期，当前Vip等级为 " + getVip());
                /*  7411 */
            } else if (expirationVip == null) {
                /*  7412 */
                setVip(0);
                /*  7413 */
                setViptime((Timestamp) null);
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  7419 */
        if (!this.pendingExpiration.isEmpty()) {
            /*  7420 */
            for (Integer itemId : this.pendingExpiration) {
                /*  7421 */
                if (ii.isCash(itemId.intValue())) {
                    /*  7422 */
                    this.client.announce(MaplePacketCreator.showCashItemExpired(itemId.intValue()));
                    continue;
                    /*       */
                }
                /*  7424 */
                this.client.announce(MaplePacketCreator.showItemExpired(itemId.intValue()));
                /*       */
            }
            /*       */
        }
        /*       */
        /*  7428 */
        this.pendingExpiration = null;
        /*       */
        /*       */
        /*       */
        /*  7432 */
        if (!this.pendingSkills.isEmpty()) {
            /*  7433 */
            this.client.announce(MaplePacketCreator.updateSkills(this.pendingSkills));
            /*  7434 */
            this.client.announce(MaplePacketCreator.showSkillExpired(this.pendingSkills));
            /*       */
        }
        /*  7436 */
        this.pendingSkills = null;
        /*  7437 */
        this.lastExpirationTime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    public MapleShop getShop() {
        /*  7441 */
        return this.shop;
        /*       */
    }

    /*       */
    /*       */
    public void setShop(MapleShop shop) {
        /*  7445 */
        this.shop = shop;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int[] getSavedLocations() {
        /*  7452 */
        return this.savedLocations;
        /*       */
    }

    /*       */
    /*       */
    public int getSavedLocation(SavedLocationType type) {
        /*  7456 */
        return this.savedLocations[type.getValue()];
        /*       */
    }

    /*       */
    /*       */
    public void saveLocation(SavedLocationType type) {
        /*  7460 */
        this.savedLocations[type.getValue()] = getMapId();
        /*  7461 */
        this.changed_savedlocations = true;
        /*       */
    }

    /*       */
    /*       */
    public void saveLocation(SavedLocationType type, int mapz) {
        /*  7465 */
        this.savedLocations[type.getValue()] = mapz;
        /*  7466 */
        this.changed_savedlocations = true;
        /*       */
    }

    /*       */
    /*       */
    public void clearSavedLocation(SavedLocationType type) {
        /*  7470 */
        this.savedLocations[type.getValue()] = -1;
        /*  7471 */
        this.changed_savedlocations = true;
        /*       */
    }

    /*       */
    /*       */
    public int getCMapCount() {
        /*  7475 */
        return this.cMapCount.getAndIncrement();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public long getMeso() {
        /*  7483 */
        return this.meso.get();
        /*       */
    }

    /*       */
    /*       */
    public void gainMeso(long gain, boolean show) {
        /*  7487 */
        gainMeso(gain, show, false);
        /*       */
    }

    /*       */
    /*       */
    public void gainMeso(long gain, boolean show, boolean inChat) {
        /*  7491 */
        if (this.meso.get() + gain < 0L) {
            /*  7492 */
            this.client.announce(MaplePacketCreator.enableActions());
            return;
            /*       */
        }
        /*  7494 */
        if (this.meso.get() + gain > ServerConfig.CHANNEL_PLAYER_MAXMESO) {
            /*  7495 */
            gain = ServerConfig.CHANNEL_PLAYER_MAXMESO - this.meso.get();
            /*       */
        }
        /*  7497 */
        this.meso.addAndGet(gain);
        /*  7498 */
        if (this.meso.get() >= 1000000L) {
            /*  7499 */
            finishAchievement(31);
            /*       */
        }
        /*  7501 */
        if (this.meso.get() >= 10000000L) {
            /*  7502 */
            finishAchievement(32);
            /*       */
        }
        /*  7504 */
        if (this.meso.get() >= 100000000L) {
            /*  7505 */
            finishAchievement(33);
            /*       */
        }
        /*  7507 */
        if (this.meso.get() >= 1000000000L) {
            /*  7508 */
            finishAchievement(34);
            /*       */
        }
        /*  7510 */
        updateSingleStat(MapleStat.金币, this.meso.get(), false);
        /*  7511 */
        this.client.announce(MaplePacketCreator.enableActions());
        /*  7512 */
        if (show) {
            /*  7513 */
            this.client.announce(MaplePacketCreator.showMesoGain(gain, inChat));
            /*       */
        }
        /*  7515 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public int getAccountID() {
        /*  7519 */
        return this.accountid;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void controlMonster(MapleMonster monster, boolean aggro, int type) {
        /*  7526 */
        if (monster == null || !monster.isAlive()) {
            /*       */
            return;
            /*       */
        }
        /*  7529 */
        this.controlledLock.writeLock().lock();
        /*       */
        try {
            /*  7531 */
            monster.setController(this);
            /*  7532 */
            this.controlled.add(monster);
            /*  7533 */
            this.client.announce(MobPacket.controlMonster(monster, false, aggro, type));
            /*  7534 */
            monster.sendStatus(this.client);
            /*       */
        } finally {
            /*  7536 */
            this.controlledLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void stopControllingMonster(MapleMonster monster) {
        /*  7541 */
        if (monster == null) {
            /*       */
            return;
            /*       */
        }
        /*  7544 */
        this.controlledLock.writeLock().lock();
        /*       */
        try {
            /*  7546 */
            monster.setControllerHasAggro(false);
            /*  7547 */
            monster.setControllerKnowsAboutAggro(false);
            /*  7548 */
            monster.setController(null);
            /*  7549 */
            if (this.controlled.contains(monster)) {
                /*  7550 */
                this.controlled.remove(monster);
                /*       */
            }
            /*  7552 */
            if (monster.getMap().getId() == getMapId()) {
                /*  7553 */
                this.client.announce(MobPacket.stopControllingMonster(monster.getObjectId()));
                /*       */
            }
            /*       */
        } finally {
            /*  7556 */
            this.controlledLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void checkMonsterAggro(MapleMonster monster) {
        /*  7561 */
        if (monster == null) {
            /*       */
            return;
            /*       */
        }
        /*  7564 */
        if (monster.getController() == this) {
            /*  7565 */
            monster.setControllerHasAggro(true);
            /*       */
        } else {
            /*  7567 */
            monster.switchController(this, true);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getControlledSize() {
        /*  7572 */
        return this.controlled.size();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<MapleQuestStatus> getStartedQuests() {
        /*  7579 */
        List<MapleQuestStatus> ret = new LinkedList<>();
        /*  7580 */
        for (MapleQuestStatus q : this.quests.values()) {
            /*  7581 */
            if (q.getStatus() == 1 && !q.isCustom() && !q.getQuest().isBlocked()) {
                /*  7582 */
                ret.add(q);
                /*       */
            }
            /*       */
        }
        /*  7585 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public List<MapleQuestStatus> getCompletedQuests() {
        /*  7589 */
        List<MapleQuestStatus> ret = new LinkedList<>();
        /*  7590 */
        for (MapleQuestStatus q : this.quests.values()) {
            /*  7591 */
            if (q.getStatus() == 2 && !q.isCustom() && !q.getQuest().isBlocked()) {
                /*  7592 */
                ret.add(q);
                /*       */
            }
            /*       */
        }
        /*  7595 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public List<Pair<Integer, Long>> getCompletedMedals() {
        /*  7599 */
        List<Pair<Integer, Long>> ret = new ArrayList<>();
        /*  7600 */
        for (MapleQuestStatus q : this.quests.values()) {
            /*  7601 */
            if (q.getStatus() == 2 && !q.isCustom() && !q.getQuest().isBlocked() && q.getQuest().getMedalItem() > 0 && ItemConstants.getInventoryType(q.getQuest().getMedalItem()) == MapleInventoryType.EQUIP) {
                /*  7602 */
                ret.add(new Pair(Integer.valueOf(q.getQuest().getId()), Long.valueOf(q.getCompletionTime())));
                /*       */
            }
            /*       */
        }
        /*  7605 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void mobKilled(int id, int skillID) {
        /*  7609 */
        for (MapleQuestStatus q : this.quests.values()) {
            /*  7610 */
            if (q.getStatus() != 1 || !q.hasMobKills()) {
                /*       */
                continue;
                /*       */
            }
            /*  7613 */
            if (q.mobKilled(id, skillID)) {
                /*  7614 */
                this.client.announce(MaplePacketCreator.updateQuestMobKills(q));
                /*  7615 */
                if (q.getQuest().canComplete(this, null)) {
                    /*  7616 */
                    this.client.announce(MaplePacketCreator.getShowQuestCompletion(q.getQuest().getId()));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<Integer, SkillEntry> getSkills() {
        /*  7626 */
        return Collections.unmodifiableMap(this.skills);
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, SkillEntry> getLinkSkills() {
        /*  7630 */
        return Collections.unmodifiableMap(this.linkSkills);
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, Pair<Integer, SkillEntry>> getSonOfLinkedSkills() {
        /*  7634 */
        return Collections.unmodifiableMap(this.sonOfLinkedSkills);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<Integer, SkillEntry> getSkills(boolean packet) {
        /*  7643 */
        if (!packet || JobConstants.is林之灵(this.job)) {
            /*  7644 */
            return Collections.unmodifiableMap(this.skills);
            /*       */
        }
        /*  7646 */
        Map<Integer, SkillEntry> oldlist = new LinkedHashMap<>(this.skills);
        /*  7647 */
        Map<Integer, SkillEntry> newlist = new LinkedHashMap<>();
        /*  7648 */
        for (Map.Entry<Integer, SkillEntry> skill : oldlist.entrySet()) {
            /*       */
            /*  7650 */
            Skill skill1 = SkillFactory.getSkill(((Integer) skill.getKey()).intValue());
            /*  7651 */
            if (skill1 != null && !skill1.isAngelSkill() && !skill1.isLinkedAttackSkill() && !skill1.isDefaultSkill()) {
                /*  7652 */
                newlist.put(skill.getKey(), skill.getValue());
                /*       */
            }
            /*       */
        }
        /*  7655 */
        return newlist;
        /*       */
    }

    /*       */
    /*       */
    public int getAllSkillLevels() {
        /*  7659 */
        int rett = 0;
        /*  7660 */
        for (Map.Entry<Integer, SkillEntry> ret : this.skills.entrySet()) {
            /*  7661 */
            Skill skill = SkillFactory.getSkill(((Integer) ret.getKey()).intValue());
            /*  7662 */
            if (!skill.isBeginnerSkill() && !skill.isSpecialSkill() && ((SkillEntry) ret.getValue()).skillevel > 0) {
                /*  7663 */
                rett += ((SkillEntry) ret.getValue()).skillevel;
                /*       */
            }
            /*       */
        }
        /*  7666 */
        return rett;
        /*       */
    }

    /*       */
    /*       */
    public long getSkillExpiry(Skill skill) {
        /*  7670 */
        if (skill == null) {
            /*  7671 */
            return 0L;
            /*       */
        }
        /*  7673 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skill.getId()));
        /*  7674 */
        if (ret == null || ret.skillevel <= 0) {
            /*  7675 */
            return 0L;
            /*       */
        }
        /*  7677 */
        return ret.expiration;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getSkillLevel(int skillid) {
        /*  7684 */
        return getSkillLevel(SkillFactory.getSkill(skillid));
        /*       */
    }

    /*       */
    public int getSkillLevel(Skill skill) {
        /*       */
        int skillLevel;
        /*  7688 */
        if (skill == null) {
            /*  7689 */
            return 0;
            /*       */
        }
        /*       */
        /*  7692 */
        if (getJob() >= skill.getId() / 10000 && getJob() < skill.getId() / 10000 + 3) {
            /*  7693 */
            skillLevel = skill.getFixLevel();
            /*       */
        } else {
            /*  7695 */
            skillLevel = 0;
            /*       */
        }
        /*  7697 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skill.getId()));
        /*  7698 */
        if (ret == null || ret.skillevel <= 0) {
            /*  7699 */
            return skillLevel;
            /*       */
        }
        /*  7701 */
        skillLevel += ret.skillevel;
        /*       */
        /*  7703 */
        return skillLevel;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getTotalSkillLevel(int skillid) {
        /*  7716 */
        return getTotalSkillLevel(SkillFactory.getSkill(SkillConstants.getLinkedAttackSkill(skillid)));
        /*       */
    }

    /*       */
    public int getTotalSkillLevel(Skill skill) {
        /*       */
        int skillLevel;
        /*  7720 */
        if (skill == null) {
            /*  7721 */
            return 0;
            /*       */
        }
        /*  7723 */
        if (SkillConstants.isGeneralSkill(skill.getId()) || SkillConstants.isExtraSkill(skill.getId()) || skill.isSoulSkill() || SkillConstants.isRuneSkill(skill.getId())) {
            /*  7724 */
            return 1;
            /*       */
        }
        /*  7726 */
        switch (skill.getId()) {
            /*       */
            case 400031008:
                /*       */
            case 400031009:
                /*  7729 */
                return getTotalSkillLevel(400031007);
            /*       */
            /*       */
            case 400011013:
                /*       */
            case 400011014:
                /*  7733 */
                return getTotalSkillLevel(400011012);
            /*       */
            /*       */
            case 400031021:
                /*  7736 */
                return getTotalSkillLevel(400031020);
            /*       */
            /*       */
            case 155100009:
                /*  7739 */
                return getTotalSkillLevel(155101008);
            /*       */
            /*       */
            case 155121006:
                /*       */
            case 155121007:
                /*  7743 */
                return getTotalSkillLevel(155121306);
            /*       */
            /*       */
            case 400011102:
                /*  7746 */
                return getTotalSkillLevel(400011090);
            /*       */
            /*       */
            case 400011069:
                /*  7749 */
                return getTotalSkillLevel(400011068);
            /*       */
            /*       */
            case 400021077:
                /*  7752 */
                return getTotalSkillLevel(400021070);
            /*       */
            /*       */
            case 164000010:
                /*  7755 */
                return 1;
            /*       */
        }
        /*       */
        /*       */
        /*  7759 */
        if (getJob() >= skill.getId() / 10000 && getJob() < skill.getId() / 10000 + 3) {
            /*  7760 */
            skillLevel = skill.getFixLevel();
            /*       */
        } else {
            /*  7762 */
            skillLevel = 0;
            /*       */
        }
        /*  7764 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skill.getId()));
        /*  7765 */
        if (skill.isLinkSkills()) {
            /*  7766 */
            ret = this.linkSkills.get(Integer.valueOf(skill.getId()));
            /*       */
        }
        /*  7768 */
        if (ret == null || ret.skillevel <= 0) {
            /*  7769 */
            return skillLevel;
            /*       */
        }
        /*  7771 */
        skillLevel += ret.skillevel;
        /*       */
        /*  7773 */
        return Math.min(skill.getTrueMax(), skillLevel + (skill.isBeginnerSkill() ? 0 : (this.stats.combatOrders + ((skill.getMaxLevel() > 10) ? this.stats.incAllskill : 0) + this.stats.getSkillIncrement(skill.getId()))));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle全箭发射(MapleCharacter player, MapleMonster monster) {
        /*  7780 */
        if (player.getBuffedValue(MapleBuffStat.全箭发射) != null) {
            /*  7781 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.全箭发射);
            /*  7782 */
            if (effect != null) {
                /*  7783 */
                int time = effect.getX();
                /*  7784 */
                int Count = effect.getY();
                /*  7785 */
                this.specialStats.gainStackCount(1);
                /*  7786 */
                send_other(ForcePacket.全箭发射(this.id, 400031029, this.specialStats.getStackCount(), monster), true);
                /*       */
                /*  7788 */
                if (System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                    /*       */
                    /*  7790 */
                    player.setLastUseVSkillTime(System.currentTimeMillis() + time);
                    /*       */
                    /*  7792 */
                    player.send(MobPacket.AllArrowLaunch(monster.getObjectId(), Count));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle念珠(int skillid) {
        /*  7806 */
        if (this.specialStats.getTotalnz() == 0) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*       */
        /*  7811 */
        if (skillid == 155001100)
            /*       */ {
            /*  7813 */
            if (this.specialStats.getTotalnz() > 0) {
                /*  7814 */
                int maxcount = 10;
                /*       */
                /*  7816 */
                if (this.specialStats.getNZ1() >= maxcount) {
                    /*       */
                    /*  7818 */
                    this.specialStats.setNZ1(maxcount);
                    /*       */
                    return;
                    /*       */
                }
                /*  7821 */
                gainNZ(1, 2);
                /*  7822 */
                this.specialStats.gainTotalnz(-1);
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*  7827 */
        if ((skillid == 155101100 || skillid == 155101101) &&
                /*  7828 */       this.specialStats.getTotalnz() > 0) {
            /*  7829 */
            int maxcount = 1;
            /*       */
            /*  7831 */
            if (this.specialStats.getNZ2() >= maxcount) {
                /*       */
                /*  7833 */
                this.specialStats.setNZ2(maxcount);
                /*       */
                /*       */
                return;
                /*       */
            }
            /*  7837 */
            gainNZ(2, 1);
            /*  7838 */
            this.specialStats.gainTotalnz(-1);
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  7843 */
        if (skillid == 155111102 &&
                /*  7844 */       this.specialStats.getTotalnz() > 0) {
            /*  7845 */
            int maxcount = 1;
            /*       */
            /*  7847 */
            if (this.specialStats.getNZ3() >= maxcount) {
                /*       */
                /*  7849 */
                this.specialStats.setNZ3(maxcount);
                /*       */
                /*       */
                return;
                /*       */
            }
            /*  7853 */
            gainNZ(3, 1);
            /*  7854 */
            this.specialStats.gainTotalnz(-1);
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*  7859 */
        if (skillid == 155121102 &&
                /*  7860 */       this.specialStats.getTotalnz() > 0) {
            /*  7861 */
            int maxcount = 1;
            /*       */
            /*  7863 */
            if (this.specialStats.getNZ4() >= maxcount) {
                /*       */
                /*  7865 */
                this.specialStats.setNZ4(maxcount);
                /*       */
                /*       */
                return;
                /*       */
            }
            /*  7869 */
            gainNZ(4, 1);
            /*  7870 */
            this.specialStats.gainTotalnz(-1);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainNZ(int mode, int nz) {
        /*  7881 */
        int shownz = 0;
        /*  7882 */
        switch (mode) {
            /*       */
            case 1:
                /*  7884 */
                this.specialStats.gainNZ1(nz);
                /*  7885 */
                shownz = this.specialStats.getNZ1();
                /*       */
                break;
            /*       */
            case 2:
                /*  7888 */
                this.specialStats.gainNZ2(nz);
                /*  7889 */
                shownz = this.specialStats.getNZ2();
                /*       */
                break;
            /*       */
            case 3:
                /*  7892 */
                this.specialStats.gainNZ3(nz);
                /*  7893 */
                shownz = this.specialStats.getNZ3();
                /*       */
                break;
            /*       */
            case 4:
                /*  7896 */
                this.specialStats.gainNZ4(nz);
                /*  7897 */
                shownz = this.specialStats.getNZ4();
                /*       */
                break;
            /*       */
        }
        /*       */
        /*  7901 */
        this.client.announce(BuffPacket.show念珠(mode, this.job, shownz));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public byte getMasterLevel(int skillId) {
        /*  7906 */
        return getMasterLevel(SkillFactory.getSkill(skillId));
        /*       */
    }

    /*       */
    /*       */
    public byte getMasterLevel(Skill skill) {
        /*  7910 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skill.getId()));
        /*  7911 */
        if (ret == null) {
            /*  7912 */
            return 0;
            /*       */
        }
        /*  7914 */
        return ret.masterlevel;
        /*       */
    }

    /*       */
    /*       */
    public int getSkillTeachId(int skillId) {
        /*  7918 */
        return getSkillTeachId(SkillFactory.getSkill(skillId));
        /*       */
    }

    /*       */
    /*       */
    public int getSkillTeachId(Skill skill) {
        /*  7922 */
        if (skill == null) {
            /*  7923 */
            return 0;
            /*       */
        }
        /*  7925 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skill.getId()));
        /*  7926 */
        if (ret == null || ret.teachId == 0) {
            /*  7927 */
            return 0;
            /*       */
        }
        /*  7929 */
        return ret.teachId;
        /*       */
    }

    /*       */
    /*       */
    public byte getSkillPosition(int skillId) {
        /*  7933 */
        return getSkillPosition(SkillFactory.getSkill(skillId));
        /*       */
    }

    /*       */
    /*       */
    public byte getSkillPosition(Skill skill) {
        /*  7937 */
        if (skill == null) {
            /*  7938 */
            return -1;
            /*       */
        }
        /*  7940 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skill.getId()));
        /*  7941 */
        if (ret == null || ret.position == -1) {
            /*  7942 */
            return -1;
            /*       */
        }
        /*  7944 */
        return ret.position;
        /*       */
    }

    /*       */
    /*       */
    public SkillEntry getSkillEntry(int skillId) {
        /*  7948 */
        return this.skills.get(Integer.valueOf(skillId));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void levelUp() {
        /*  7955 */
        levelUp(false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void levelUp(boolean takeexp) {
        /*  7960 */
        if (ServerConfig.CHANNEL_PLAYER_CANLEVELUP && !canLevelUp()) {
            /*       */
            return;
            /*       */
        }
        /*  7963 */
        if (JobConstants.is炎术士(this.job) || JobConstants.is夜行者(this.job)) {
            /*  7964 */
            if (this.level <= 70) {
                /*  7965 */
                this.remainingAp = (short) (this.remainingAp + 6);
                /*       */
            } else {
                /*  7967 */
                this.remainingAp = (short) (this.remainingAp + 5);
                /*       */
            }
            /*       */
        } else {
            /*  7970 */
            this.remainingAp = (short) (this.remainingAp + 5);
            /*       */
        }
        /*  7972 */
        int maxhp = this.stats.getMaxHp();
        /*  7973 */
        int maxmp = this.stats.getMaxMp();
        /*       */
        /*  7975 */
        if (JobConstants.is新手职业(this.job)) {
            /*  7976 */
            maxhp += Randomizer.rand(12, 16);
            /*  7977 */
            maxmp += Randomizer.rand(10, 12);
            /*  7978 */
        } else if (JobConstants.is恶魔猎手(this.job) || JobConstants.is超能力者(this.job)) {
            /*  7979 */
            maxhp += Randomizer.rand(48, 52);
            /*  7980 */
        } else if (JobConstants.is恶魔复仇者(this.job) || JobConstants.is阴阳师(this.job)) {
            /*  7981 */
            maxhp += Randomizer.rand(30, 40);
            /*  7982 */
        } else if ((this.job >= 100 && this.job <= 132) || (this.job >= 1100 && this.job <= 1112) || (this.job >= 5100 && this.job <= 5112) ||
                /*       */
                /*       */
                /*  7985 */       JobConstants.is影魂异人(this.job) ||
                /*  7986 */       JobConstants.is品克缤(this.job)) {
            /*  7987 */
            maxhp += Randomizer.rand(48, 52);
            /*  7988 */
            maxmp += Randomizer.rand(4, 6);
            /*  7989 */
        } else if ((this.job >= 200 && this.job <= 232) || (this.job >= 1200 && this.job <= 1212) || (this.job >= 2700 && this.job <= 2712) ||
                /*       */
                /*       */
                /*  7992 */       JobConstants.is圣晶使徒(this.job)) {
            /*  7993 */
            maxhp += Randomizer.rand(10, 14);
            /*  7994 */
            maxmp += Randomizer.rand(48, 52);
            /*  7995 */
        } else if (this.job >= 3200 && this.job <= 3212) {
            /*  7996 */
            maxhp += Randomizer.rand(20, 24);
            /*  7997 */
            maxmp += Randomizer.rand(42, 44);
            /*  7998 */
        } else if ((this.job >= 300 && this.job <= 322) || (this.job >= 400 && this.job <= 434) || (this.job >= 1300 && this.job <= 1312) || (this.job >= 1400 && this.job <= 1412) || (this.job >= 2300 && this.job <= 2312) || (this.job >= 2400 && this.job <= 2412) || (this.job >= 3300 && this.job <= 3312) ||
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*  8005 */       JobConstants.is魔链隐士(this.job) || (this.job >= 3600 && this.job <= 3612) ||
                /*       */
                /*  8007 */       JobConstants.is古迹猎人(this.job) ||
                /*  8008 */       JobConstants.is虎影(this.job) ||
                /*  8009 */       JobConstants.is御剑骑士(this.job)) {
            /*       */
            /*  8011 */
            maxhp += Randomizer.rand(20, 24);
            /*  8012 */
            maxmp += Randomizer.rand(14, 16);
            /*  8013 */
        } else if ((this.job >= 510 && this.job <= 512) || (this.job >= 580 && this.job <= 582) || (this.job >= 1510 && this.job <= 1512) || (this.job >= 6500 && this.job <= 6512)) {
            /*       */
            /*       */
            /*       */
            /*  8017 */
            maxhp += Randomizer.rand(37, 41);
            /*  8018 */
            maxmp += Randomizer.rand(18, 22);
            /*  8019 */
        } else if ((this.job >= 500 && this.job <= 532) || (this.job >= 570 && this.job <= 572) || this.job == 508 || (this.job >= 590 && this.job <= 592) || (this.job >= 3500 && this.job <= 3512) || this.job == 1500) {
            /*       */
            /*       */
            /*       */
            /*       */
            /*  8024 */
            maxhp += Randomizer.rand(22, 26);
            /*  8025 */
            maxmp += Randomizer.rand(18, 22);
            /*  8026 */
        } else if (this.job >= 2100 && this.job <= 2112) {
            /*  8027 */
            maxhp += Randomizer.rand(50, 52);
            /*  8028 */
            maxmp += Randomizer.rand(4, 6);
            /*  8029 */
        } else if (JobConstants.is龙神(this.job)) {
            /*  8030 */
            maxhp += Randomizer.rand(12, 16);
            /*  8031 */
            maxmp += Randomizer.rand(50, 52);
            /*  8032 */
        } else if (this.job >= 6100 && this.job <= 6112) {
            /*  8033 */
            maxhp += Randomizer.rand(68, 74);
            /*  8034 */
            maxmp += Randomizer.rand(4, 6);
            /*  8035 */
        } else if (this.job >= 10100 && this.job <= 10112) {
            /*  8036 */
            maxhp += Randomizer.rand(48, 52);
            /*  8037 */
        } else if (JobConstants.is林之灵(this.job) || JobConstants.is隐月(this.job) || JobConstants.is剑豪(this.job)) {
            /*  8038 */
            maxhp += Randomizer.rand(38, 42);
            /*  8039 */
            maxmp += Randomizer.rand(20, 24);
            /*  8040 */
        } else if (JobConstants.is爆破手(this.job)) {
            /*  8041 */
            maxhp += Randomizer.rand(48, 75);
            /*  8042 */
            maxmp += Randomizer.rand(8, 18);
            /*       */
        } else {
            /*  8044 */
            maxhp += Randomizer.rand(24, 38);
            /*  8045 */
            maxmp += Randomizer.rand(12, 24);
            /*  8046 */
            if (this.job != 800 && this.job != 900 && this.job != 910) {
                /*  8047 */
                System.err.println("出现未处理的角色升级加血职业: " + this.job);
                /*       */
            }
            /*       */
        }
        /*  8050 */
        maxmp += JobConstants.isNotMpJob(getJob()) ? 0 : (this.stats.getTotalInt() / 10);
        /*  8051 */
        if (JobConstants.is夜光(this.job) && getSkillLevel(20040221) > 0) {
            /*  8052 */
            maxmp += Randomizer.rand(18, 22);
            /*       */
        }
        /*  8054 */
        if (takeexp) {
            /*  8055 */
            this.exp.addAndGet(getExpNeededForLevel());
            /*  8056 */
            if (this.exp.get() < 0L) {
                /*  8057 */
                this.exp.set(0L);
                /*       */
            }
            /*       */
        } else {
            /*  8060 */
            setExp(0L);
            /*       */
        }
        /*  8062 */
        this.level++;
        /*  8063 */
        if (this.level >= getMaxLevelForSever()) {
            /*  8064 */
            setExp(0L);
            /*       */
        }
        /*  8066 */
        maxhp = Math.min(getMaxHpForSever(), Math.abs(maxhp));
        /*  8067 */
        maxmp = Math.min(getMaxMpForSever(), Math.abs(maxmp));
        /*  8068 */
        if (JobConstants.is恶魔猎手(this.job)) {
            /*  8069 */
            maxmp = GameConstants.getMPByJob(this.job);
            /*  8070 */
        } else if (JobConstants.is神之子(this.job)) {
            /*  8071 */
            maxmp = 100;
            /*  8072 */
            checkZeroWeapon();
            /*  8073 */
        } else if (JobConstants.isNotMpJob(this.job)) {
            /*  8074 */
            maxmp = 10;
            /*       */
        }
        /*       */
        /*  8077 */
        if (this.level == 30) {
            /*  8078 */
            finishAchievement(2);
            /*       */
        }
        /*  8080 */
        if (this.level == 70) {
            /*  8081 */
            finishAchievement(3);
            /*       */
        }
        /*  8083 */
        if (this.level == 120) {
            /*  8084 */
            finishAchievement(4);
            /*       */
        }
        /*  8086 */
        if (this.level == 200) {
            /*  8087 */
            forceCompleteQuest(34478);
            /*  8088 */
            finishAchievement(5);
            /*       */
        }
        /*  8090 */
        if (this.level == 275 && !isGM()) {
            /*       */
            /*  8092 */
            String sb = "[祝贺] " + getMedalText() + getName() + "终于达到了275级.大家一起祝贺下吧。";
            /*       */
            /*  8094 */
            WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(6, sb));
            /*       */
        }
        /*       */
        /*  8097 */
        List<Pair<MapleStat, Long>> statup = new ArrayList<>();
        /*       */
        /*  8099 */
        if (!JobConstants.is新手职业(this.job)) {
            /*  8100 */
            if (JobConstants.is神之子(this.job) && this.level >= 100) {
                /*  8101 */
                this.remainingSp[0] = this.remainingSp[0] + 3;
                /*  8102 */
                this.remainingSp[1] = this.remainingSp[1] + 3;
                /*  8103 */
            } else if (!JobConstants.is品克缤(this.job)) {
                /*  8104 */
                this.remainingSp[JobConstants.getSkillBookByLevel(this.job, this.level)] = this.remainingSp[JobConstants.getSkillBookByLevel(this.job, this.level)] + 3;
                /*       */
            }
            /*  8106 */
        } else if (this.level < 10) {
            /*  8107 */
            this.stats.str = (short) (this.stats.str + this.remainingAp);
            /*  8108 */
            this.remainingAp = 0;
            /*  8109 */
            statup.add(new Pair(MapleStat.力量, Long.valueOf(this.stats.getStr())));
            /*  8110 */
        } else if (this.level == 10) {
            /*  8111 */
            resetStats(4, 4, 4, 4);
            /*       */
        }
        /*  8113 */
        this.stats.setInfo(maxhp, maxmp, this.stats.getCurrentMaxHp(), this.stats.getCurrentMaxMp(this.job));
        /*  8114 */
        this.characterCard.recalcLocalStats(this);
        /*  8115 */
        this.stats.recalcLocalStats(this);
        /*  8116 */
        statup.add(new Pair(MapleStat.MAXHP, Long.valueOf(maxhp)));
        /*  8117 */
        statup.add(new Pair(MapleStat.MAXMP, Long.valueOf(maxmp)));
        /*  8118 */
        statup.add(new Pair(MapleStat.HP, Long.valueOf(this.stats.getCurrentMaxHp())));
        /*  8119 */
        statup.add(new Pair(MapleStat.MP, Long.valueOf(this.stats.getCurrentMaxMp(this.job))));
        /*  8120 */
        statup.add(new Pair(MapleStat.经验, Long.valueOf(this.exp.get())));
        /*  8121 */
        statup.add(new Pair(MapleStat.等级, Long.valueOf(this.level)));
        /*  8122 */
        statup.add(new Pair(MapleStat.AVAILABLEAP, Long.valueOf(this.remainingAp)));
        /*  8123 */
        statup.add(new Pair(MapleStat.AVAILABLESP, Long.valueOf(this.remainingSp[JobConstants.getSkillBookByLevel(this.job, this.level)])));
        /*  8124 */
        this.client.announce(MaplePacketCreator.updatePlayerStats(statup, this));
        /*  8125 */
        this.map.broadcastMessage(this, EffectPacket.showForeignEffect(getId(), 0), false);
        /*  8126 */
        silentPartyUpdate();
        /*  8127 */
        guildUpdate();
        /*  8128 */
        familyUpdate();
        /*  8129 */
        baseSkills();
        /*  8130 */
        changeTeachSkillsLevel();
        /*  8131 */
        checkBeastTamerSkill();
        /*       */
        /*  8133 */
        if (JobConstants.is龙的传人(getJob()) && getSkillLevel(1214) > 0) {
            /*  8134 */
            if (this.coreAura == null) {
                /*  8135 */
                this.coreAura = MapleCoreAura.createCoreAura(this.id, this.level);
                /*       */
            } else {
                /*  8137 */
                this.coreAura.setLevel(this.level);
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*  8147 */
        int tecahskill = JobConstants.getTecahSkillID(this.job);
        /*  8148 */
        if (tecahskill != -1) {
            /*  8149 */
            if (this.level >= 70 && this.level < 120) {
                /*  8150 */
                if (!hasSkill(this.skills, tecahskill, 1)) {
                    /*  8151 */
                    changeSingleSkillLevel(SkillFactory.getSkill(tecahskill), 1, (byte) 1);
                    /*       */
                }
                /*  8153 */
            } else if (this.level >= 120 && this.level < 210) {
                /*  8154 */
                if (!hasSkill(this.skills, tecahskill, 2)) {
                    /*  8155 */
                    changeSingleSkillLevel(SkillFactory.getSkill(tecahskill), 2, (byte) 2);
                    /*       */
                }
                /*  8157 */
            } else if (this.level >= 210 &&
                    /*  8158 */         !hasSkill(this.skills, tecahskill, 3)) {
                /*  8159 */
                changeSingleSkillLevel(SkillFactory.getSkill(tecahskill), 3, (byte) 3);
                /*       */
            }
            /*       */
        }
        /*       */
        /*  8163 */
        insertRanking("等级排行", this.level);
        /*  8164 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public boolean canLevelUp() {
        /*  8168 */
        boolean canLevelUp = true;
        /*  8169 */
        String textinfo = "";
        /*  8170 */
        switch (getJob()) {
            /*       */
            case 0:
                /*       */
            case 1000:
                /*       */
            case 2000:
                /*       */
            case 2001:
                /*       */
            case 2002:
                /*       */
            case 2003:
                /*       */
            case 2004:
                /*       */
            case 2005:
                /*       */
            case 3000:
                /*       */
            case 3001:
                /*       */
            case 3002:
                /*       */
            case 4001:
                /*       */
            case 4002:
                /*       */
            case 5000:
                /*       */
            case 6000:
                /*       */
            case 6001:
                /*       */
            case 6002:
                /*       */
            case 11000:
                /*       */
            case 14000:
                /*       */
            case 15000:
                /*       */
            case 15001:
                /*       */
            case 15002:
                /*       */
            case 16000:
                /*  8194 */
                if (getLevel() >= 10) {
                    /*  8195 */
                    canLevelUp = false;
                    /*  8196 */
                    textinfo = "您现在可以进行第一次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            /*       */
            /*       */
            case 100:
                /*       */
            case 200:
                /*       */
            case 300:
                /*       */
            case 301:
                /*       */
            case 500:
                /*       */
            case 501:
                /*       */
            case 508:
                /*       */
            case 1100:
                /*       */
            case 1200:
                /*       */
            case 1300:
                /*       */
            case 1400:
                /*       */
            case 1500:
                /*       */
            case 2100:
                /*       */
            case 2200:
                /*       */
            case 2300:
                /*       */
            case 2400:
                /*       */
            case 2500:
                /*       */
            case 2700:
                /*       */
            case 3100:
                /*       */
            case 3101:
                /*       */
            case 3200:
                /*       */
            case 3300:
                /*       */
            case 3500:
                /*       */
            case 3600:
                /*       */
            case 3700:
                /*       */
            case 4100:
                /*       */
            case 4200:
                /*       */
            case 5100:
                /*       */
            case 6100:
                /*       */
            case 6400:
                /*       */
            case 6500:
                /*       */
            case 14200:
                /*       */
            case 15100:
                /*       */
            case 15200:
                /*       */
            case 15500:
                /*       */
            case 16400:
                /*  8238 */
                if (getLevel() >= 30) {
                    /*  8239 */
                    canLevelUp = false;
                    /*  8240 */
                    textinfo = "您现在可以进行第二次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            case 110:
                /*       */
            case 120:
                /*       */
            case 130:
                /*       */
            case 210:
                /*       */
            case 220:
                /*       */
            case 230:
                /*       */
            case 310:
                /*       */
            case 320:
                /*       */
            case 330:
                /*       */
            case 410:
                /*       */
            case 420:
                /*       */
            case 510:
                /*       */
            case 520:
                /*       */
            case 530:
                /*       */
            case 570:
                /*       */
            case 1110:
                /*       */
            case 1210:
                /*       */
            case 1310:
                /*       */
            case 1410:
                /*       */
            case 1510:
                /*       */
            case 2110:
                /*       */
            case 2211:
                /*       */
            case 2310:
                /*       */
            case 2410:
                /*       */
            case 2510:
                /*       */
            case 2710:
                /*       */
            case 3110:
                /*       */
            case 3120:
                /*       */
            case 3210:
                /*       */
            case 3310:
                /*       */
            case 3510:
                /*       */
            case 3610:
                /*       */
            case 3710:
                /*       */
            case 4110:
                /*       */
            case 4210:
                /*       */
            case 5110:
                /*       */
            case 6110:
                /*       */
            case 6410:
                /*       */
            case 6510:
                /*       */
            case 14210:
                /*       */
            case 15110:
                /*       */
            case 15210:
                /*       */
            case 15510:
                /*       */
            case 16410:
                /*  8291 */
                if (getLevel() >= 60) {
                    /*  8292 */
                    canLevelUp = false;
                    /*       */
                    /*  8294 */
                    textinfo = "您现在可以进行第三次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            /*       */
            /*       */
            /*       */
            case 111:
                /*       */
            case 121:
                /*       */
            case 131:
                /*       */
            case 211:
                /*       */
            case 221:
                /*       */
            case 231:
                /*       */
            case 311:
                /*       */
            case 321:
                /*       */
            case 331:
                /*       */
            case 411:
                /*       */
            case 421:
                /*       */
            case 511:
                /*       */
            case 521:
                /*       */
            case 531:
                /*       */
            case 571:
                /*       */
            case 1111:
                /*       */
            case 1211:
                /*       */
            case 1311:
                /*       */
            case 1411:
                /*       */
            case 1511:
                /*       */
            case 2111:
                /*       */
            case 2214:
                /*       */
            case 2311:
                /*       */
            case 2411:
                /*       */
            case 2511:
                /*       */
            case 2711:
                /*       */
            case 3111:
                /*       */
            case 3121:
                /*       */
            case 3211:
                /*       */
            case 3311:
                /*       */
            case 3511:
                /*       */
            case 3611:
                /*       */
            case 3711:
                /*       */
            case 4111:
                /*       */
            case 4211:
                /*       */
            case 5111:
                /*       */
            case 6111:
                /*       */
            case 6411:
                /*       */
            case 6511:
                /*       */
            case 14211:
                /*       */
            case 15111:
                /*       */
            case 15211:
                /*       */
            case 15511:
                /*       */
            case 16411:
                /*  8345 */
                if (getLevel() >= 100) {
                    /*  8346 */
                    canLevelUp = false;
                    /*       */
                    /*  8348 */
                    textinfo = "您现在可以进行第四次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            /*       */
            /*       */
            case 400:
                /*  8355 */
                if (getSubcategory() == 1) {
                    /*  8356 */
                    if (getLevel() >= 20) {
                        /*  8357 */
                        canLevelUp = false;
                        /*  8358 */
                        textinfo = "您现在可以进行第二次转职了，在右下角点击商城按钮开始转职吧。";
                        /*       */
                    }
                    break;
                    /*  8360 */
                }
                if (getLevel() >= 30) {
                    /*  8361 */
                    canLevelUp = false;
                    /*  8362 */
                    textinfo = "您现在可以进行第二次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            case 430:
                /*  8367 */
                if (getLevel() >= 30) {
                    /*  8368 */
                    canLevelUp = false;
                    /*  8369 */
                    textinfo = "您现在可以进行第三次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            case 431:
                /*  8374 */
                if (getLevel() >= 45) {
                    /*  8375 */
                    canLevelUp = false;
                    /*  8376 */
                    textinfo = "您现在可以进行第四次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            case 432:
                /*  8381 */
                if (getLevel() >= 60) {
                    /*  8382 */
                    canLevelUp = false;
                    /*  8383 */
                    textinfo = "您现在可以进行第五次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            case 433:
                /*  8388 */
                if (getLevel() >= 100) {
                    /*  8389 */
                    canLevelUp = false;
                    /*  8390 */
                    textinfo = "您现在可以进行第六次转职了，在右下角点击商城按钮开始转职吧。";
                    /*       */
                }
                /*       */
                break;
            /*       */
        }
        /*       */
        /*  8395 */
        if (!canLevelUp) {
            /*  8396 */
            dropMessage(5, "[转职提示] " + textinfo);
            /*  8397 */
            return false;
            /*       */
        }
        /*  8399 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeKeybinding(int key, byte type, int action) {
        /*  8406 */
        if (type != 0) {
            /*  8407 */
            this.keylayout.Layout().put(Integer.valueOf(key), new Pair(Byte.valueOf(type), Integer.valueOf(action)));
            /*       */
        } else {
            /*  8409 */
            this.keylayout.Layout().remove(Integer.valueOf(key));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void sendMacros() {
        /*  8417 */
        this.client.announce(MaplePacketCreator.getMacros(this.skillMacros));
        /*       */
    }

    /*       */
    /*       */
    public void updateMacros(int position, SkillMacro updateMacro) {
        /*  8421 */
        this.skillMacros[position] = updateMacro;
        /*  8422 */
        this.changed_skillmacros = true;
        /*       */
    }

    /*       */
    /*       */
    public SkillMacro[] getMacros() {
        /*  8426 */
        return this.skillMacros;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void tempban(String reason, Calendar duration, int greason, boolean IPMac) {
        /*  8433 */
        if (IPMac) {
            /*  8434 */
            this.client.banMacs();
            /*       */
        }
        /*       */
        /*  8437 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*       */
            /*  8439 */
            if (IPMac) {
                /*  8440 */
                PreparedStatement preparedStatement = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?)");
                /*  8441 */
                preparedStatement.setString(1, this.client.getSessionIPAddress());
                /*  8442 */
                preparedStatement.execute();
                /*  8443 */
                preparedStatement.close();
                /*       */
            }
            /*  8445 */
            this.client.disconnect(true, false);
            /*  8446 */
            this.client.getSession().close();
            /*  8447 */
            PreparedStatement ps = con.prepareStatement("UPDATE accounts SET tempban = ?, banreason = ?, greason = ? WHERE id = ?");
            /*  8448 */
            Timestamp TS = new Timestamp(duration.getTimeInMillis());
            /*  8449 */
            ps.setTimestamp(1, TS);
            /*  8450 */
            ps.setString(2, reason);
            /*  8451 */
            ps.setInt(3, greason);
            /*  8452 */
            ps.setInt(4, this.accountid);
            /*  8453 */
            ps.execute();
            /*  8454 */
            ps.close();
            /*  8455 */
        } catch (SQLException ex) {
            /*  8456 */
            System.err.println("Error while tempbanning" + ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean ban(String reason, boolean IPMac, boolean autoban, boolean hellban) {
        /*  8464 */
        gainWarning(false);
        /*       */
        /*  8466 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  8467 */
            PreparedStatement ps = con.prepareStatement("UPDATE accounts SET banned = ?, banreason = ? WHERE id = ?");
            /*  8468 */
            ps.setInt(1, autoban ? 2 : 1);
            /*  8469 */
            ps.setString(2, reason);
            /*  8470 */
            ps.setInt(3, this.accountid);
            /*  8471 */
            ps.execute();
            /*  8472 */
            ps.close();
            /*  8473 */
            if (IPMac) {
                /*  8474 */
                this.client.banMacs();
                /*  8475 */
                ps = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?)");
                /*  8476 */
                ps.setString(1, this.client.getSessionIPAddress());
                /*  8477 */
                ps.execute();
                /*  8478 */
                ps.close();
                /*  8479 */
                if (hellban) {
                    /*  8480 */
                    PreparedStatement psa = con.prepareStatement("SELECT * FROM accounts WHERE id = ?");
                    /*  8481 */
                    psa.setInt(1, this.accountid);
                    /*  8482 */
                    ResultSet rsa = psa.executeQuery();
                    /*  8483 */
                    if (rsa.next()) {
                        /*  8484 */
                        PreparedStatement pss = con.prepareStatement("UPDATE accounts SET banned = ?, banreason = ? WHERE email = ? OR SessionIP = ?");
                        /*  8485 */
                        pss.setInt(1, autoban ? 2 : 1);
                        /*  8486 */
                        pss.setString(2, reason);
                        /*  8487 */
                        pss.setString(3, rsa.getString("email"));
                        /*  8488 */
                        pss.setString(4, this.client.getSessionIPAddress());
                        /*  8489 */
                        pss.execute();
                        /*  8490 */
                        pss.close();
                        /*       */
                    }
                    /*  8492 */
                    rsa.close();
                    /*  8493 */
                    psa.close();
                    /*       */
                }
                /*       */
            }
            /*  8496 */
        } catch (SQLException ex) {
            /*  8497 */
            System.err.println("Error while banning" + ex);
            /*  8498 */
            return false;
            /*       */
        }
        /*  8500 */
        this.client.disconnect(true, false);
        /*  8501 */
        this.client.getSession().close();
        /*  8502 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getObjectId() {
        /*  8512 */
        return getId();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setObjectId(int id) {
        /*  8522 */
        throw new UnsupportedOperationException();
        /*       */
    }

    /*       */
    /*       */
    public MapleStorage getStorage() {
        /*  8526 */
        return this.storage;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addVisibleMapObject(MapleMapObject mo) {
        /*  8535 */
        this.visibleMapObjectsLock.writeLock().lock();
        /*       */
        try {
            /*  8537 */
            this.visibleMapObjects.add(mo);
            /*       */
        } finally {
            /*  8539 */
            this.visibleMapObjectsLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void removeVisibleMapObject(MapleMapObject mo) {
        /*  8549 */
        this.visibleMapObjectsLock.writeLock().lock();
        /*       */
        try {
            /*  8551 */
            this.visibleMapObjects.remove(mo);
            /*       */
        } finally {
            /*  8553 */
            this.visibleMapObjectsLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean isMapObjectVisible(MapleMapObject mo) {
        /*  8564 */
        this.visibleMapObjectsLock.readLock().lock();
        /*       */
        try {
            /*  8566 */
            return this.visibleMapObjects.contains(mo);
            /*       */
        } finally {
            /*  8568 */
            this.visibleMapObjectsLock.readLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public Collection<MapleMapObject> getAndWriteLockVisibleMapObjects() {
        /*  8573 */
        this.visibleMapObjectsLock.writeLock().lock();
        /*  8574 */
        return this.visibleMapObjects;
        /*       */
    }

    /*       */
    /*       */
    public void unlockWriteVisibleMapObjects() {
        /*  8578 */
        this.visibleMapObjectsLock.writeLock().unlock();
        /*       */
    }

    /*       */
    /*       */
    public boolean isAlive() {
        /*  8582 */
        return (this.stats.getHp() > 0);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void sendDestroyData(MapleClient client) {
        /*  8592 */
        client.announce(MaplePacketCreator.removePlayerFromMap(getObjectId()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void sendSpawnData(MapleClient client) {
        /*  8602 */
        if (client.getPlayer().allowedToTarget(this)) {
            /*       */
            /*  8604 */
            client.announce(MaplePacketCreator.spawnPlayerMapobject(this));
            /*  8605 */
            client.announce(EffectPacket.getEffectSwitch(getId(), getEffectSwitch()));
            /*       */
            /*  8607 */
            if (getParty() != null) {
                /*  8608 */
                updatePartyMemberHP();
                /*  8609 */
                receivePartyMemberHP();
                /*       */
            }
            /*       */
            /*  8612 */
            if (this.dragon != null) {
                /*  8613 */
                client.announce(SummonPacket.spawnDragon(this.dragon));
                /*       */
            }
            /*  8615 */
            if (this.lw != null) {
                /*  8616 */
                client.announce(SummonPacket.spawnLittleWhite(this.lw));
                /*       */
            }
            /*       */
            /*  8619 */
            if (this.android != null) {
                /*  8620 */
                client.announce(AndroidPacket.spawnAndroid(this, this.android));
                /*       */
            }
            /*  8622 */
            if (this.summons != null && this.summons.size() > 0) {
                /*  8623 */
                this.summonsLock.readLock().lock();
                /*       */
                try {
                    /*  8625 */
                    for (MapleSummon summon : this.summons) {
                        /*  8626 */
                        if (summon.getOwner() != null) {
                            /*  8627 */
                            client.announce(SummonPacket.spawnSummon(summon, false));
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                } finally {
                    /*  8631 */
                    this.summonsLock.readLock().unlock();
                    /*       */
                }
                /*       */
            }
            /*  8634 */
            if (this.followid > 0 && this.followon) {
                /*  8635 */
                client.announce(MaplePacketCreator.followEffect(this.followinitiator ? this.followid : this.id, this.followinitiator ? this.id : this.followid, null));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void equipChanged() {
        /*  8641 */
        if (this.map == null) {
            /*       */
            return;
            /*       */
        }
        /*  8644 */
        this.map.broadcastMessage(this, MaplePacketCreator.updateCharLook(this), false);
        /*  8645 */
        this.stats.recalcLocalStats(this);
        /*  8646 */
        if (getMessenger() != null) {
            /*  8647 */
            WorldMessengerService.getInstance().updateMessenger(getMessenger().getId(), getName(), this.client.getChannel());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkCopyItems() {
        /*  8656 */
        if (!ServerConfig.WORLD_CHECKPLAYEREQUIP) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /*  8660 */
        List<Integer> equipOnlyIds = new ArrayList<>();
        /*  8661 */
        Map<Integer, Integer> checkItems = new HashMap<>();
        /*       */
        /*  8663 */
        for (Item item : getInventory(MapleInventoryType.EQUIP).list()) {
            /*  8664 */
            int equipOnlyId = item.getEquipOnlyId();
            /*  8665 */
            if (equipOnlyId > 0) {
                /*  8666 */
                if (checkItems.containsKey(Integer.valueOf(equipOnlyId))) {
                    /*  8667 */
                    if (((Integer) checkItems.get(Integer.valueOf(equipOnlyId))).intValue() == item.getItemId())
                        /*  8668 */ equipOnlyIds.add(Integer.valueOf(equipOnlyId));
                    /*       */
                    continue;
                    /*       */
                }
                /*  8671 */
                checkItems.put(Integer.valueOf(equipOnlyId), Integer.valueOf(item.getItemId()));
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*  8676 */
        for (Item item : getInventory(MapleInventoryType.EQUIPPED).list()) {
            /*  8677 */
            int equipOnlyId = item.getEquipOnlyId();
            /*  8678 */
            if (equipOnlyId > 0) {
                /*  8679 */
                if (checkItems.containsKey(Integer.valueOf(equipOnlyId))) {
                    /*  8680 */
                    if (((Integer) checkItems.get(Integer.valueOf(equipOnlyId))).intValue() == item.getItemId())
                        /*  8681 */ equipOnlyIds.add(Integer.valueOf(equipOnlyId));
                    /*       */
                    continue;
                    /*       */
                }
                /*  8684 */
                checkItems.put(Integer.valueOf(equipOnlyId), Integer.valueOf(item.getItemId()));
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /*  8689 */
        boolean autoban = false;
        /*  8690 */
        for (Integer equipOnlyId : equipOnlyIds) {
            /*  8691 */
            MapleInventoryManipulator.removeAllByEquipOnlyId(this.client, equipOnlyId.intValue());
            /*  8692 */
            autoban = true;
            /*       */
        }
        /*  8694 */
        if (autoban) {
            /*  8695 */
            AutobanManager.getInstance().autoban(this.client, "复制装备.");
            /*       */
        }
        /*  8697 */
        checkItems.clear();
        /*  8698 */
        equipOnlyIds.clear();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<MaplePet> getPets() {
        /*  8705 */
        List<MaplePet> ret = new ArrayList<>();
        /*  8706 */
        for (Item item : getInventory(MapleInventoryType.CASH).newList()) {
            /*  8707 */
            if (item.getPet() != null) {
                /*  8708 */
                ret.add(item.getPet());
                /*       */
            }
            /*       */
        }
        /*  8711 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MaplePet[] getSpawnPets() {
        /*  8718 */
        return this.spawnPets;
        /*       */
    }

    /*       */
    /*       */
    public MaplePet getSpawnPet(int index) {
        /*  8722 */
        return this.spawnPets[index];
        /*       */
    }

    /*       */
    /*       */
    public byte getPetIndex(int petId) {
        /*  8726 */
        for (byte i = 0; i < 3; i = (byte) (i + 1)) {
            /*  8727 */
            if (this.spawnPets[i] != null && this.spawnPets[i].getUniqueId() == petId) {
                /*  8728 */
                return i;
                /*       */
            }
            /*       */
        }
        /*  8731 */
        return -1;
        /*       */
    }

    /*       */
    /*       */
    public byte getPetIndex(MaplePet pet) {
        /*  8735 */
        for (byte i = 0; i < 3; i = (byte) (i + 1)) {
            /*  8736 */
            if (this.spawnPets[i] != null && this.spawnPets[i].getUniqueId() == pet.getUniqueId()) {
                /*  8737 */
                return i;
                /*       */
            }
            /*       */
        }
        /*  8740 */
        return -1;
        /*       */
    }

    /*       */
    /*       */
    public byte getPetByItemId(int petItemId) {
        /*  8744 */
        for (byte i = 0; i < 3; i = (byte) (i + 1)) {
            /*  8745 */
            if (this.spawnPets[i] != null && this.spawnPets[i].getPetItemId() == petItemId) {
                /*  8746 */
                return i;
                /*       */
            }
            /*       */
        }
        /*  8749 */
        return -1;
        /*       */
    }

    /*       */
    /*       */
    public int getNextEmptyPetIndex() {
        /*  8753 */
        for (int i = 0; i < 3; i++) {
            /*  8754 */
            if (this.spawnPets[i] == null) {
                /*  8755 */
                return i;
                /*       */
            }
            /*       */
        }
        /*  8758 */
        return 3;
        /*       */
    }

    /*       */
    /*       */
    public int getNoPets() {
        /*  8762 */
        int ret = 0;
        /*  8763 */
        for (int i = 0; i < 3; i++) {
            /*  8764 */
            if (this.spawnPets[i] != null) {
                /*  8765 */
                ret++;
                /*       */
            }
            /*       */
        }
        /*  8768 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public List<MaplePet> getSummonedPets() {
        /*  8772 */
        List<MaplePet> ret = new ArrayList<>();
        /*  8773 */
        for (byte i = 0; i < 3; i = (byte) (i + 1)) {
            /*  8774 */
            if (this.spawnPets[i] != null && this.spawnPets[i].getSummoned()) {
                /*  8775 */
                ret.add(this.spawnPets[i]);
                /*       */
            }
            /*       */
        }
        /*  8778 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void addSpawnPet(MaplePet pet) {
        /*  8782 */
        for (int i = 0; i < 3; i++) {
            /*  8783 */
            if (this.spawnPets[i] == null) {
                /*  8784 */
                this.spawnPets[i] = pet;
                /*  8785 */
                pet.setSummoned((byte) (i + 1));
                /*       */
                return;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void removeSpawnPet(MaplePet pet, boolean shiftLeft) {
        /*  8792 */
        for (int i = 0; i < 3; i++) {
            /*  8793 */
            if (this.spawnPets[i] != null &&
                    /*  8794 */         this.spawnPets[i].getUniqueId() == pet.getUniqueId()) {
                /*  8795 */
                this.spawnPets[i] = null;
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void unequipAllSpawnPets() {
        /*  8803 */
        for (int i = 0; i < 3; i++) {
            /*  8804 */
            if (this.spawnPets[i] != null) {
                /*  8805 */
                unequipSpawnPet(this.spawnPets[i], true, false);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void spawnPet(short slot) {
        /*  8811 */
        spawnPet(slot, false, true);
        /*       */
    }

    /*       */
    /*       */
    public void spawnPet(short slot, boolean lead) {
        /*  8815 */
        spawnPet(slot, lead, true);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void spawnPet(short slot, boolean lead, boolean broadcast) {
        /*       */
        MaplePet pet;
        /*  8826 */
        Item item = getInventory(MapleInventoryType.CASH).getItem(slot);
        /*  8827 */
        if (item == null || !ItemConstants.isPet(item.getItemId())) {
            /*  8828 */
            this.client.announce(MaplePacketCreator.enableActions());
            /*       */
            return;
            /*       */
        }
        /*  8831 */
        switch (item.getItemId()) {
            /*       */
            case 5000028:
                /*       */
            case 5000047:
                /*  8834 */
                pet = MaplePet.createPet(item.getItemId() + 1, MapleInventoryIdentifier.getInstance());
                /*  8835 */
                if (pet != null) {
                    /*  8836 */
                    MapleInventoryManipulator.addById(this.client, item.getItemId() + 1, (short) 1, item.getOwner(), pet, 90L, "双击宠物获得: " + item.getItemId() + " 时间: " + DateUtil.getCurrentDate());
                    /*  8837 */
                    MapleInventoryManipulator.removeFromSlot(this.client, MapleInventoryType.CASH, slot, (short) 1, false);
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            default:
                /*  8842 */
                pet = item.getPet();
                /*  8843 */
                if (pet != null && (item.getItemId() != 5000054 || pet.getSecondsLeft() > 0) && (item.getExpiration() == -1L || item.getExpiration() > System.currentTimeMillis())) {
                    /*  8844 */
                    if (getPetIndex(pet) != -1) {
                        /*  8845 */
                        unequipSpawnPet(pet, true, false);
                        break;
                        /*       */
                    }
                    /*  8847 */
                    int leadid = 8;
                    /*  8848 */
                    if (JobConstants.is骑士团(getJob())) {
                        /*  8849 */
                        leadid = 10000018;
                        /*  8850 */
                    } else if (JobConstants.is战神(getJob())) {
                        /*  8851 */
                        leadid = 20000024;
                        /*  8852 */
                    } else if (JobConstants.is龙神(getJob())) {
                        /*  8853 */
                        leadid = 20011024;
                        /*  8854 */
                    } else if (JobConstants.is剑豪(getJob())) {
                        /*  8855 */
                        leadid = 40011024;
                        /*  8856 */
                    } else if (JobConstants.is阴阳师(getJob())) {
                        /*  8857 */
                        leadid = 40021024;
                        /*       */
                    }
                    /*       */
                    /*  8860 */
                    if ((getSkillLevel(SkillFactory.getSkill(leadid)) == 0 || getNoPets() == 3) && getSpawnPet(0) != null) {
                        /*  8861 */
                        unequipSpawnPet(getSpawnPet(0), false, false);
                        /*  8862 */
                    } else if (lead && getSkillLevel(SkillFactory.getSkill(leadid)) > 0) {
                        /*  8863 */
                        shiftPetsRight();
                        /*       */
                    }
                    /*  8865 */
                    Point pos = getPosition();
                    /*  8866 */
                    pos.y -= 12;
                    /*  8867 */
                    pet.setPos(pos);
                    /*       */
                    try {
                        /*  8869 */
                        pet.setFh(getMap().getFootholds().findBelow(pet.getPos(), true).getId());
                        /*  8870 */
                    } catch (NullPointerException e) {
                        /*  8871 */
                        pet.setFh(0);
                        /*       */
                    }
                    /*  8873 */
                    pet.setStance(0);
                    /*  8874 */
                    if (getSkillLevel(pet.getBuffSkill()) == 0) {
                        /*  8875 */
                        pet.setBuffSkill(0);
                        /*       */
                    }
                    /*  8877 */
                    pet.setCanPickup((getIntRecord(122902) > 0));
                    /*  8878 */
                    addSpawnPet(pet);
                    /*  8879 */
                    if (getMap() != null) {
                        /*  8880 */
                        petUpdateStats(pet, true);
                        /*  8881 */
                        getMap().broadcastMessage(this, PetPacket.showPet(this, pet, false, false), true);
                        /*  8882 */
                        this.client.announce(PetPacket.loadExceptionList(this, pet));
                        /*       */
                        /*  8884 */
                        checkPetSkill();
                        /*       */
                    }
                    /*       */
                }
                /*       */
                break;
            /*       */
        }
        /*       */
        /*       */
        /*  8891 */
        this.client.announce(MaplePacketCreator.enableActions());
        /*       */
    }

    /*       */
    /*       */
    public void unequipSpawnPet(MaplePet pet, boolean shiftLeft, boolean hunger) {
        /*  8895 */
        if (getSpawnPet(getPetIndex(pet)) != null) {
            /*  8896 */
            getSpawnPet(getPetIndex(pet)).setSummoned(0);
            /*  8897 */
            getSpawnPet(getPetIndex(pet)).saveToDb();
            /*       */
        }
        /*  8899 */
        petUpdateStats(pet, false);
        /*  8900 */
        if (this.map != null) {
            /*  8901 */
            this.map.broadcastMessage(this, PetPacket.showPet(this, pet, true, hunger), true);
            /*       */
        }
        /*  8903 */
        removeSpawnPet(pet, shiftLeft);
        /*  8904 */
        checkPetSkill();
        /*       */
        /*       */
        /*       */
        /*       */
        /*  8909 */
        this.client.announce(MaplePacketCreator.enableActions());
        /*       */
    }

    /*       */
    /*       */
    public void shiftPetsRight() {
        /*  8913 */
        if (this.spawnPets[2] == null) {
            /*  8914 */
            this.spawnPets[2] = this.spawnPets[1];
            /*  8915 */
            this.spawnPets[1] = this.spawnPets[0];
            /*  8916 */
            this.spawnPets[0] = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void checkPetSkill() {
        /*  8921 */
        Map<Integer, Integer> setHandling = new HashMap<>();
        /*  8922 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /*  8923 */
        for (int i = 0; i < 3; i++) {
            /*  8924 */
            if (this.spawnPets[i] != null) {
                /*  8925 */
                int set = ii.getPetSetItemID(this.spawnPets[i].getPetItemId());
                /*  8926 */
                if (set > 0) {
                    /*  8927 */
                    int value = 1;
                    /*  8928 */
                    if (setHandling.containsKey(Integer.valueOf(set))) {
                        /*  8929 */
                        value += ((Integer) setHandling.get(Integer.valueOf(set))).intValue();
                        /*       */
                    }
                    /*  8931 */
                    setHandling.put(Integer.valueOf(set), Integer.valueOf(value));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*  8935 */
        if (setHandling.isEmpty()) {
            /*  8936 */
            Map<Integer, SkillEntry> chrSkill = new HashMap<>(getSkills());
            /*  8937 */
            Map<Integer, SkillEntry> petSkill = new HashMap<>();
            /*  8938 */
            for (Map.Entry<Integer, SkillEntry> skill : chrSkill.entrySet()) {
                /*  8939 */
                Skill skill1 = SkillFactory.getSkill(((Integer) skill.getKey()).intValue());
                /*  8940 */
                if (skill1 != null && skill1.isPetPassive()) {
                    /*  8941 */
                    petSkill.put(skill.getKey(), new SkillEntry(0, (byte) 0, -1L));
                    /*       */
                }
                /*       */
            }
            /*  8944 */
            if (!petSkill.isEmpty()) {
                /*  8945 */
                changePetSkillLevel(petSkill);
                /*       */
            }
            /*       */
            return;
            /*       */
        }
        /*  8949 */
        Map<Integer, SkillEntry> petSkillData = new HashMap<>();
        /*  8950 */
        for (Map.Entry<Integer, Integer> entry : setHandling.entrySet()) {
            /*  8951 */
            StructSetItem setItem = ii.getSetItem(((Integer) entry.getKey()).intValue());
            /*  8952 */
            if (setItem != null) {
                /*  8953 */
                Map<Integer, StructSetItemStat> setItemStats = setItem.getSetItemStats();
                /*  8954 */
                for (Map.Entry<Integer, StructSetItemStat> ent : setItemStats.entrySet()) {
                    /*  8955 */
                    StructSetItemStat setItemStat = ent.getValue();
                    /*  8956 */
                    if (((Integer) ent.getKey()).intValue() <= ((Integer) entry.getValue()).intValue()) {
                        /*  8957 */
                        if (setItemStat.skillId > 0 && setItemStat.skillLevel > 0 && getSkillLevel(setItemStat.skillId) <= 0)
                            /*  8958 */
                            petSkillData.put(Integer.valueOf(setItemStat.skillId), new SkillEntry((byte) setItemStat.skillLevel, (byte) 0, -1L));
                        continue;
                        /*       */
                    }
                    /*  8960 */
                    if (setItemStat.skillId > 0 && setItemStat.skillLevel > 0 && getSkillLevel(setItemStat.skillId) > 0) {
                        /*  8961 */
                        petSkillData.put(Integer.valueOf(setItemStat.skillId), new SkillEntry(0, (byte) 0, -1L));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*  8966 */
        if (!petSkillData.isEmpty()) {
            /*  8967 */
            changePetSkillLevel(petSkillData);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public long getLastFameTime() {
        /*  8972 */
        return this.lastfametime;
        /*       */
    }

    /*       */
    /*       */
    public List<Integer> getFamedCharacters() {
        /*  8976 */
        return this.lastmonthfameids;
        /*       */
    }

    /*       */
    /*       */
    public List<Integer> getBattledCharacters() {
        /*  8980 */
        return this.lastmonthbattleids;
        /*       */
    }

    /*       */
    /*       */
    public FameStatus canGiveFame(MapleCharacter from) {
        /*  8984 */
        if (this.lastfametime >= System.currentTimeMillis() - 86400000L)
            /*  8985 */ return FameStatus.NOT_TODAY;
        /*  8986 */
        if (from == null || this.lastmonthfameids == null || this.lastmonthfameids.contains(Integer.valueOf(from.getId()))) {
            /*  8987 */
            return FameStatus.NOT_THIS_MONTH;
            /*       */
        }
        /*  8989 */
        return FameStatus.OK;
        /*       */
    }

    /*       */
    /*       */
    public void hasGivenFame(MapleCharacter to) {
        /*  8993 */
        this.lastfametime = System.currentTimeMillis();
        /*  8994 */
        this.lastmonthfameids.add(Integer.valueOf(to.getId()));
        /*  8995 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  8996 */
            PreparedStatement ps = con.prepareStatement("INSERT INTO famelog (characterid, characterid_to) VALUES (?, ?)");
            /*  8997 */
            ps.setInt(1, getId());
            /*  8998 */
            ps.setInt(2, to.getId());
            /*  8999 */
            ps.execute();
            /*  9000 */
            ps.close();
            /*  9001 */
        } catch (SQLException e) {
            /*  9002 */
            System.err.println("ERROR writing famelog for char " + getName() + " to " + to.getName() + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean canBattle(MapleCharacter to) {
        /*  9007 */
        return (to != null && this.lastmonthbattleids != null && !this.lastmonthbattleids.contains(Integer.valueOf(to.getAccountID())));
        /*       */
    }

    /*       */
    /*       */
    public void hasBattled(MapleCharacter to) {
        /*  9011 */
        this.lastmonthbattleids.add(Integer.valueOf(to.getAccountID()));
        /*  9012 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  9013 */
            PreparedStatement ps = con.prepareStatement("INSERT INTO battlelog (accid, accid_to) VALUES (?, ?)");
            /*  9014 */
            ps.setInt(1, getAccountID());
            /*  9015 */
            ps.setInt(2, to.getAccountID());
            /*  9016 */
            ps.execute();
            /*  9017 */
            ps.close();
            /*  9018 */
        } catch (SQLException e) {
            /*  9019 */
            System.err.println("ERROR writing battlelog for char " + getName() + " to " + to.getName() + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleKeyLayout getKeyLayout() {
        /*  9024 */
        return this.keylayout;
        /*       */
    }

    /*       */
    /*       */
    public MapleQuickSlot getQuickSlot() {
        /*  9028 */
        return this.quickslot;
        /*       */
    }

    /*       */
    /*       */
    public MapleParty getParty() {
        /*  9032 */
        if (this.party == null)
            /*  9033 */ return null;
        /*  9034 */
        if (this.party.isDisbanded()) {
            /*  9035 */
            this.party = null;
            /*       */
        }
        /*  9037 */
        return this.party;
        /*       */
    }

    /*       */
    /*       */
    public void setParty(MapleParty party) {
        /*  9041 */
        this.party = party;
        /*       */
    }

    /*       */
    /*       */
    public byte getWorld() {
        /*  9045 */
        return this.world;
        /*       */
    }

    /*       */
    /*       */
    public void setWorld(byte world) {
        /*  9049 */
        this.world = world;
        /*       */
    }

    /*       */
    /*       */
    public MapleTrade getTrade() {
        /*  9053 */
        return this.trade;
        /*       */
    }

    /*       */
    /*       */
    public void setTrade(MapleTrade trade) {
        /*  9057 */
        this.trade = trade;
        /*       */
    }

    /*       */
    /*       */
    public EventInstanceManager getEventInstance() {
        /*  9061 */
        return this.eventInstance;
        /*       */
    }

    /*       */
    /*       */
    public void setEventInstance(EventInstanceManager eventInstance) {
        /*  9065 */
        this.eventInstance = eventInstance;
        /*       */
    }

    /*       */
    /*       */
    public void addDoor(MapleDoor door) {
        /*  9069 */
        this.doors.add(door);
        /*       */
    }

    /*       */
    /*       */
    public void clearDoors() {
        /*  9073 */
        this.doors.clear();
        /*       */
    }

    /*       */
    /*       */
    public List<MapleDoor> getDoors() {
        /*  9077 */
        return new ArrayList<>(this.doors);
        /*       */
    }

    /*       */
    /*       */
    public void addMechDoor(MechDoor door) {
        /*  9081 */
        this.mechDoors.add(door);
        /*       */
    }

    /*       */
    /*       */
    public void clearMechDoors() {
        /*  9085 */
        this.mechDoors.clear();
        /*       */
    }

    /*       */
    /*       */
    public List<MechDoor> getMechDoors() {
        /*  9089 */
        return new ArrayList<>(this.mechDoors);
        /*       */
    }

    /*       */
    /*       */
    public void setSmega() {
        /*  9093 */
        if (this.smega) {
            /*  9094 */
            this.smega = false;
            /*  9095 */
            dropMessage(5, "You have set megaphone to disabled mode");
            /*       */
        } else {
            /*  9097 */
            this.smega = true;
            /*  9098 */
            dropMessage(5, "You have set megaphone to enabled mode");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean getSmega() {
        /*  9103 */
        return this.smega;
        /*       */
    }

    /*       */
    /*       */
    public int getChair() {
        /*  9107 */
        return this.chair;
        /*       */
    }

    /*       */
    /*       */
    public void setChair(int chair) {
        /*  9111 */
        this.chair = chair;
        /*  9112 */
        this.stats.relocHeal(this);
        /*       */
    }

    /*       */
    /*       */
    public int getChairType() {
        /*  9116 */
        return this.chairType;
        /*       */
    }

    /*       */
    /*       */
    public void setChairType(int chairType) {
        /*  9120 */
        this.chairType = chairType;
        /*       */
    }

    /*       */
    /*       */
    public String getChairMsg() {
        /*  9124 */
        return this.chairMsg;
        /*       */
    }

    /*       */
    /*       */
    public void setChairMsg(String chairMsg) {
        /*  9128 */
        this.chairMsg = chairMsg;
        /*       */
    }

    /*       */
    /*       */
    public long getChairMeso() {
        /*  9132 */
        return this.chairMeso;
        /*       */
    }

    /*       */
    /*       */
    public void setChairMeso(long chairMeso) {
        /*  9136 */
        this.chairMeso = chairMeso;
        /*       */
    }

    /*       */
    /*       */
    public int getItemEffect() {
        /*  9140 */
        return this.itemEffect;
        /*       */
    }

    /*       */
    /*       */
    public void setItemEffect(int itemEffect) {
        /*  9144 */
        this.itemEffect = itemEffect;
        /*       */
    }

    /*       */
    /*       */
    public int getItemEffectType() {
        /*  9148 */
        return this.itemEffectType;
        /*       */
    }

    /*       */
    /*       */
    public void setItemEffectType(int itemEffectType) {
        /*  9152 */
        this.itemEffectType = itemEffectType;
        /*       */
    }

    /*       */
    /*       */
    public int getTitleEffect() {
        /*  9156 */
        return this.titleEffect;
        /*       */
    }

    /*       */
    /*       */
    public void setTitleEffect(int titleEffect) {
        /*  9160 */
        this.titleEffect = titleEffect;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public MapleMapObjectType getType() {
        /*  9165 */
        return MapleMapObjectType.PLAYER;
        /*       */
    }

    /*       */
    /*       */
    public int getFamilyId() {
        /*  9169 */
        if (this.mfc == null) {
            /*  9170 */
            return 0;
            /*       */
        }
        /*  9172 */
        return this.mfc.getFamilyId();
        /*       */
    }

    /*       */
    /*       */
    public int getSeniorId() {
        /*  9176 */
        if (this.mfc == null) {
            /*  9177 */
            return 0;
            /*       */
        }
        /*  9179 */
        return this.mfc.getSeniorId();
        /*       */
    }

    /*       */
    /*       */
    public int getJunior1() {
        /*  9183 */
        if (this.mfc == null) {
            /*  9184 */
            return 0;
            /*       */
        }
        /*  9186 */
        return this.mfc.getJunior1();
        /*       */
    }

    /*       */
    /*       */
    public int getJunior2() {
        /*  9190 */
        if (this.mfc == null) {
            /*  9191 */
            return 0;
            /*       */
        }
        /*  9193 */
        return this.mfc.getJunior2();
        /*       */
    }

    /*       */
    /*       */
    public int getCurrentRep() {
        /*  9197 */
        return this.currentrep;
        /*       */
    }

    /*       */
    /*       */
    public void setCurrentRep(int newRank) {
        /*  9201 */
        this.currentrep = newRank;
        /*  9202 */
        if (this.mfc != null) {
            /*  9203 */
            this.mfc.setCurrentRep(newRank);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getTotalRep() {
        /*  9208 */
        return this.totalrep;
        /*       */
    }

    /*       */
    /*       */
    public void setTotalRep(int newRank) {
        /*  9212 */
        this.totalrep = newRank;
        /*  9213 */
        if (this.mfc != null) {
            /*  9214 */
            this.mfc.setTotalRep(newRank);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getTotalWins() {
        /*  9219 */
        return this.totalWins;
        /*       */
    }

    /*       */
    /*       */
    public int getTotalLosses() {
        /*  9223 */
        return this.totalLosses;
        /*       */
    }

    /*       */
    /*       */
    public void increaseTotalWins() {
        /*  9227 */
        this.totalWins++;
        /*       */
    }

    /*       */
    /*       */
    public void increaseTotalLosses() {
        /*  9231 */
        this.totalLosses++;
        /*       */
    }

    /*       */
    /*       */
    public int getGuildId() {
        /*  9235 */
        return this.guildid;
        /*       */
    }

    /*       */
    /*       */
    public void setGuildId(int newGuildId) {
        /*  9239 */
        this.guildid = newGuildId;
        /*  9240 */
        if (this.guildid > 0) {
            /*  9241 */
            if (this.mgc == null) {
                /*  9242 */
                this.mgc = new MapleGuildCharacter(this);
                /*       */
            } else {
                /*  9244 */
                this.mgc.setGuildId(this.guildid);
                /*       */
            }
            /*       */
        } else {
            /*  9247 */
            this.mgc = null;
            /*  9248 */
            this.guildContribution = 0;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public byte getGuildRank() {
        /*  9253 */
        return this.guildrank;
        /*       */
    }

    /*       */
    /*       */
    public void setGuildRank(byte newRank) {
        /*  9257 */
        this.guildrank = newRank;
        /*  9258 */
        if (this.mgc != null) {
            /*  9259 */
            this.mgc.setGuildRank(newRank);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getGuildContribution() {
        /*  9264 */
        return this.guildContribution;
        /*       */
    }

    /*       */
    /*       */
    public void setGuildContribution(int newContribution) {
        /*  9268 */
        this.guildContribution = newContribution;
        /*  9269 */
        if (this.mgc != null) {
            /*  9270 */
            this.mgc.setGuildContribution(newContribution);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleGuildCharacter getMGC() {
        /*  9275 */
        return this.mgc;
        /*       */
    }

    /*       */
    /*       */
    public byte getAllianceRank() {
        /*  9279 */
        return this.allianceRank;
        /*       */
    }

    /*       */
    /*       */
    public void setAllianceRank(byte newRank) {
        /*  9283 */
        this.allianceRank = newRank;
        /*  9284 */
        if (this.mgc != null) {
            /*  9285 */
            this.mgc.setAllianceRank(newRank);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleGuild getGuild() {
        /*  9290 */
        if (getGuildId() <= 0) {
            /*  9291 */
            return null;
            /*       */
        }
        /*  9293 */
        return WorldGuildService.getInstance().getGuild(getGuildId());
        /*       */
    }

    /*       */
    /*       */
    public void guildUpdate() {
        /*  9297 */
        if (this.guildid <= 0) {
            /*       */
            return;
            /*       */
        }
        /*  9300 */
        this.mgc.setLevel(this.level);
        /*  9301 */
        this.mgc.setJobId(this.job);
        /*  9302 */
        WorldGuildService.getInstance().memberLevelJobUpdate(this.mgc);
        /*       */
    }

    /*       */
    /*       */
    public void saveGuildStatus() {
        /*  9306 */
        MapleGuild.setOfflineGuildStatus(this.guildid, this.guildrank, this.guildContribution, this.allianceRank, this.id);
        /*       */
    }

    /*       */
    /*       */
    public void familyUpdate() {
        /*  9310 */
        if (this.mfc == null) {
            /*       */
            return;
            /*       */
        }
        /*  9313 */
        WorldFamilyService.getInstance().memberFamilyUpdate(this.mfc, this);
        /*       */
    }

    /*       */
    /*       */
    public void saveFamilyStatus() {
        /*  9317 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  9318 */
            PreparedStatement ps = con.prepareStatement("UPDATE characters SET familyid = ?, seniorid = ?, junior1 = ?, junior2 = ? WHERE id = ?");
            /*  9319 */
            if (this.mfc == null) {
                /*  9320 */
                ps.setInt(1, 0);
                /*  9321 */
                ps.setInt(2, 0);
                /*  9322 */
                ps.setInt(3, 0);
                /*  9323 */
                ps.setInt(4, 0);
                /*       */
            } else {
                /*  9325 */
                ps.setInt(1, this.mfc.getFamilyId());
                /*  9326 */
                ps.setInt(2, this.mfc.getSeniorId());
                /*  9327 */
                ps.setInt(3, this.mfc.getJunior1());
                /*  9328 */
                ps.setInt(4, this.mfc.getJunior2());
                /*       */
            }
            /*  9330 */
            ps.setInt(5, this.id);
            /*  9331 */
            ps.executeUpdate();
            /*  9332 */
            ps.close();
            /*  9333 */
        } catch (SQLException se) {
            /*  9334 */
            log.error(se);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public boolean modifyCSPoints(int type, int quantity) {
        /*  9340 */
        return modifyCSPoints(type, quantity, false);
        /*       */
    }

    /*       */
    /*       */
    public boolean modifyCSPoints(int type, int quantity, boolean show) {
        /*  9344 */
        switch (type) {
            /*       */
            case 1:
                /*  9346 */
                if (getACash() + quantity < 0) {
                    /*  9347 */
                    if (show) {
                        /*  9348 */
                        dropMessage(-1, "You have gained the max cash. No cash will be awarded.");
                        /*       */
                    }
                    /*       */
                    /*  9351 */
                    return false;
                    /*       */
                }
                /*  9353 */
                setACash(getACash() + quantity);
                /*       */
                break;
            /*       */
            case 2:
                /*  9356 */
                if (getMaplePoints() + quantity < 0) {
                    /*  9357 */
                    if (show) {
                        /*  9358 */
                        dropMessage(-1, "You have gained the max maple points. No cash will be awarded.");
                        /*       */
                    }
                    /*       */
                    /*  9361 */
                    return false;
                    /*       */
                }
                /*  9363 */
                setMaplePoints(getMaplePoints() + quantity);
                /*       */
                break;
            /*       */
        }
        /*       */
        /*       */
        /*  9368 */
        if (show && quantity != 0) {
            /*  9369 */
            dropMessage(-1, "您" + ((quantity > 0) ? "获得了 " : "消耗了 ") + Math.abs(quantity) + ((type == 1) ? " 点券." : " 抵用券."));
            /*       */
        }
        /*       */
        /*  9372 */
        this.client.announce(MaplePacketCreator.showCharCash(this));
        /*  9373 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getCSPoints(int type) {
        /*  9378 */
        switch (type) {
            /*       */
            case 1:
                /*  9380 */
                return getACash();
            /*       */
            case 2:
                /*  9382 */
                return getMaplePoints();
            /*       */
            case -1:
                /*  9384 */
                return getACash() + getMaplePoints();
            /*       */
        }
        /*  9386 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getTotalRMB() {
        /*  9391 */
        int rmb = 0;
        /*  9392 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  9393 */
            PreparedStatement ps = con.prepareStatement("SELECT SUM(rmb) FROM paylog WHERE account = ?");
            /*  9394 */
            ps.setString(1, getClient().getAccountName());
            /*  9395 */
            ResultSet rs = ps.executeQuery();
            /*  9396 */
            if (rs.next()) {
                /*  9397 */
                rmb = rs.getInt(1);
                /*       */
            }
            /*  9399 */
            ps.close();
            /*  9400 */
        } catch (SQLException Ex) {
            /*  9401 */
            log.error("获取账号充值总数失败.", Ex);
            /*       */
        }
        /*  9403 */
        return rmb;
        /*       */
    }

    /*       */
    /*       */
    public List<Pair<String, Integer>> getTotalRMBRanking(int limit) {
        /*  9407 */
        List<Pair<String, Integer>> ret = new LinkedList<>();
        /*  9408 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  9409 */
            Calendar c = Calendar.getInstance();
            /*  9410 */
            c.set(c.get(1), c.get(2), 1, 0, 0, 0);
            /*  9411 */
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            /*  9412 */
            PreparedStatement ps = con.prepareStatement("SELECT account, SUM(rmb) FROM paylog WHERE date(`paytime`) >= ? GROUP BY account ORDER BY rmb DESC LIMIT ?");
            /*  9413 */
            ps.setString(1, sdf.format(Long.valueOf(c.getTime().getTime())));
            /*  9414 */
            ps.setInt(2, limit);
            /*  9415 */
            ResultSet rs = ps.executeQuery();
            /*  9416 */
            while (rs.next()) {
                /*  9417 */
                ret.add(new Pair(rs.getString("account"), Integer.valueOf(rs.getInt("rmb"))));
                /*       */
            }
            /*  9419 */
            ps.close();
            /*  9420 */
        } catch (SQLException Ex) {
            /*  9421 */
            log.error("获取账号充值总数失败.", Ex);
            /*       */
        }
        /*  9423 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public int getRMB() {
        /*  9427 */
        int point = 0;
        /*  9428 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /*  9429 */         PreparedStatement ps = con.prepareStatement("SELECT rmb FROM accounts WHERE name = ?")) {
            /*  9430 */
            ps.setString(1, getClient().getAccountName());
            /*  9431 */
            try (ResultSet rs = ps.executeQuery()) {
                /*  9432 */
                if (rs.next()) {
                    /*  9433 */
                    point = rs.getInt("rmb");
                    /*       */
                }
                /*       */
            }
            /*       */
            /*  9437 */
        } catch (SQLException e) {
            /*  9438 */
            log.error("获取角色rmb失败。", e);
            /*       */
        }
        /*  9440 */
        return point;
        /*       */
    }

    /*       */
    /*       */
    public void setRMB(int point) {
        /*  9444 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /*  9445 */         PreparedStatement ps = con.prepareStatement("UPDATE accounts SET rmb = ? WHERE name = ?")) {
            /*  9446 */
            ps.setInt(1, point);
            /*  9447 */
            ps.setString(2, getClient().getAccountName());
            /*  9448 */
            ps.executeUpdate();
            /*       */
        }
        /*  9450 */ catch (SQLException e) {
            /*  9451 */
            log.error("角色设置RMB失败。", e);
            /*       */
        }
        /*  9453 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public void gainRMB(int point) {
        /*  9457 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /*  9458 */         PreparedStatement ps = con.prepareStatement("UPDATE accounts SET rmb = rmb + ? WHERE name = ?")) {
            /*  9459 */
            ps.setInt(1, point);
            /*  9460 */
            ps.setString(2, getClient().getAccountName());
            /*  9461 */
            ps.executeUpdate();
            /*       */
        }
        /*  9463 */ catch (SQLException e) {
            /*  9464 */
            log.error("角色增加RMB失败。", e);
            /*       */
        }
        /*  9466 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public boolean hasEquipped(int itemid) {
        /*  9470 */
        return (this.inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid) >= 1);
        /*       */
    }

    /*       */
    /*       */
    public boolean haveItem(int itemid, int quantity, boolean checkEquipped, boolean greaterOrEquals) {
        /*  9474 */
        MapleInventoryType type = ItemConstants.getInventoryType(itemid);
        /*  9475 */
        int possesed = this.inventory[type.ordinal()].countById(itemid);
        /*  9476 */
        if (checkEquipped && type == MapleInventoryType.EQUIP) {
            /*  9477 */
            possesed += this.inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
            /*       */
        }
        /*  9479 */
        if (greaterOrEquals) {
            /*  9480 */
            return (possesed >= quantity);
            /*       */
        }
        /*  9482 */
        return (possesed == quantity);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public boolean haveItem(int itemid, int quantity) {
        /*  9487 */
        return haveItem(itemid, quantity, true, true);
        /*       */
    }

    /*       */
    /*       */
    public boolean haveItem(int itemid) {
        /*  9491 */
        return haveItem(itemid, 1, true, true);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getItemQuantity(int itemid) {
        /*  9498 */
        MapleInventoryType type = ItemConstants.getInventoryType(itemid);
        /*  9499 */
        return getInventory(type).countById(itemid);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getItemQuantity(int itemid, boolean checkEquipped) {
        /*  9506 */
        int possesed = this.inventory[ItemConstants.getInventoryType(itemid).ordinal()].countById(itemid);
        /*  9507 */
        if (checkEquipped) {
            /*  9508 */
            possesed += this.inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
            /*       */
        }
        /*  9510 */
        return possesed;
        /*       */
    }

    /*       */
    /*       */
    public int getEquipId(short slot) {
        /*  9514 */
        MapleInventory equip = getInventory(MapleInventoryType.EQUIP);
        /*  9515 */
        return equip.getItem(slot).getItemId();
        /*       */
    }

    /*       */
    /*       */
    public int getUseId(short slot) {
        /*  9519 */
        MapleInventory use = getInventory(MapleInventoryType.USE);
        /*  9520 */
        return use.getItem(slot).getItemId();
        /*       */
    }

    /*       */
    /*       */
    public int getSetupId(short slot) {
        /*  9524 */
        MapleInventory setup = getInventory(MapleInventoryType.SETUP);
        /*  9525 */
        return setup.getItem(slot).getItemId();
        /*       */
    }

    /*       */
    /*       */
    public int getCashId(short slot) {
        /*  9529 */
        MapleInventory cash = getInventory(MapleInventoryType.CASH);
        /*  9530 */
        return cash.getItem(slot).getItemId();
        /*       */
    }

    /*       */
    /*       */
    public int getEtcId(short slot) {
        /*  9534 */
        MapleInventory etc = getInventory(MapleInventoryType.ETC);
        /*  9535 */
        return etc.getItem(slot).getItemId();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public byte getBuddyCapacity() {
        /*  9543 */
        return this.buddylist.getCapacity();
        /*       */
    }

    /*       */
    /*       */
    public void setBuddyCapacity(byte capacity) {
        /*  9547 */
        this.buddylist.setCapacity(capacity);
        /*  9548 */
        this.client.announce(BuddyListPacket.updateBuddyCapacity(capacity));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleMessenger getMessenger() {
        /*  9555 */
        return this.messenger;
        /*       */
    }

    /*       */
    /*       */
    public void setMessenger(MapleMessenger messenger) {
        /*  9559 */
        this.messenger = messenger;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<MapleSummon> getSummonsReadLock() {
        /*  9566 */
        this.summonsLock.readLock().lock();
        /*  9567 */
        return this.summons;
        /*       */
    }

    /*       */
    /*       */
    public int getSummonsSize() {
        /*  9571 */
        return this.summons.size();
        /*       */
    }

    /*       */
    /*       */
    public void unlockSummonsReadLock() {
        /*  9575 */
        this.summonsLock.readLock().unlock();
        /*       */
    }

    /*       */
    /*       */
    public void addSummon(MapleSummon s) {
        /*  9579 */
        this.summonsLock.writeLock().lock();
        /*       */
        try {
            /*  9581 */
            this.summons.add(s);
            /*       */
        } finally {
            /*  9583 */
            this.summonsLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public final int getSummonsCount(int skillid) {
        /*  9588 */
        this.summonsLock.readLock().lock();
        /*       */
        try {
            /*  9590 */
            int count = 0;
            /*  9591 */
            for (MapleSummon summon : this.summons) {
                /*  9592 */
                if (summon.getSkillId() == skillid) {
                    /*  9593 */
                    count++;
                    /*       */
                }
                /*       */
            }
            /*  9596 */
            return count;
            /*       */
        } finally {
            /*  9598 */
            this.summonsLock.readLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public final List<Integer> getSummonsOIDsBySkillID(int skillid) {
        /*  9603 */
        this.summonsLock.readLock().lock();
        /*       */
        try {
            /*  9605 */
            ArrayList<Integer> list = new ArrayList<>();
            /*  9606 */
            this.summons.parallelStream().filter(summon -> (summon.getSkillId() == skillid)).forEach(summon -> list.add(Integer.valueOf(summon.getObjectId())));
            /*  9607 */
            return list;
            /*       */
        } finally {
            /*  9609 */
            this.summonsLock.readLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public final MapleSummon getSummonBySkillID(int n) {
        /*  9614 */
        this.summonsLock.readLock().lock();
        /*       */
        try {
            /*  9616 */
            for (MapleSummon summon : this.summons) {
                /*  9617 */
                if (summon.getSkillId() == n) {
                    /*  9618 */
                    return summon;
                    /*       */
                }
                /*       */
            }
            /*  9621 */
            return null;
            /*       */
        } finally {
            /*  9623 */
            this.summonsLock.readLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void removeSummon(MapleSummon s) {
        /*  9628 */
        this.summonsLock.writeLock().lock();
        /*       */
        try {
            /*  9630 */
            this.summons.remove(s);
            /*       */
        } finally {
            /*  9632 */
            this.summonsLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void removeSummon(int Skillid) {
        /*  9643 */
        this.summonsLock.writeLock().lock();
        /*  9644 */
        MapleSummon delet = null;
        /*       */
        try {
            /*  9646 */
            for (MapleSummon su : this.summons) {
                /*  9647 */
                if (su.getSkillId() == Skillid) {
                    /*  9648 */
                    delet = su;
                    /*       */
                }
                /*       */
            }
            /*  9651 */
            if (delet != null) {
                /*  9652 */
                getMap().broadcastMessage(SummonPacket.removeSummon(delet, true));
                /*  9653 */
                getMap().removeMapObject((MapleMapObject) delet);
                /*  9654 */
                removeVisibleMapObject((MapleMapObject) delet);
                /*  9655 */
                this.summons.remove(delet);
                /*       */
            }
            /*       */
        } finally {
            /*  9658 */
            this.summonsLock.writeLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean hasSummonBySkill(int skillId) {
        /*  9666 */
        if (this.summons == null || this.summons.isEmpty()) {
            /*  9667 */
            return false;
            /*       */
        }
        /*  9669 */
        this.summonsLock.readLock().lock();
        /*       */
        try {
            /*  9671 */
            for (MapleSummon summon : this.summons) {
                /*  9672 */
                if (summon.getSkillId() == skillId) {
                    /*  9673 */
                    return true;
                    /*       */
                }
                /*       */
            }
            /*       */
        } finally {
            /*  9677 */
            this.summonsLock.readLock().unlock();
            /*       */
        }
        /*  9679 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleSummon getSummonBySkill(int skillId) {
        /*  9689 */
        if (hasSummonBySkill(skillId)) {
            /*  9690 */
            this.summonsLock.readLock().lock();
            /*       */
            try {
                /*  9692 */
                for (MapleSummon summon : this.summons) {
                    /*  9693 */
                    if (summon.getSkillId() == skillId) {
                        /*  9694 */
                        return summon;
                        /*       */
                    }
                    /*       */
                }
                /*       */
            } finally {
                /*  9698 */
                this.summonsLock.readLock().unlock();
                /*       */
            }
            /*       */
        }
        /*  9701 */
        return null;
        /*       */
    }

    /*       */
    /*       */
    public void updateSummonBySkillID(int skillId, int newSkillId, boolean animated) {
        /*  9705 */
        this.summonsLock.readLock().lock();
        /*       */
        try {
            /*  9707 */
            this.summons.forEach(summon -> {
                /*       */
                if (summon.getSkillId() == skillId) {
                    /*       */
                    summon.setSkillId(newSkillId);
                    /*       */
                    getMap().broadcastMessage(SummonPacket.removeSummon(summon, animated));
                    /*       */
                }
                /*       */
            });
            /*       */
        } finally {
            /*  9714 */
            this.summonsLock.readLock().unlock();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void addCooldown(MapleStatEffect effect) {
        /*  9720 */
        int duration = effect.getDuration(this);
        /*  9721 */
        addCooldown(effect.getSourceid(), System.currentTimeMillis(), (isAdmin() && duration > 0) ? 100L : (duration * 1000));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addCooldown(int skillId, long startTime, long length) {
        /*  9728 */
        this.coolDowns.put(Integer.valueOf(skillId), new MapleCoolDownValueHolder(skillId, startTime, length));
        /*       */
    }

    /*       */
    /*       */
    public boolean isSkillCooling(int skillid) {
        /*  9732 */
        return this.coolDowns.containsKey(Integer.valueOf(skillid));
        /*       */
    }

    /*       */
    /*       */
    public void removeCooldown(int skillId) {
        /*  9736 */
        if (this.coolDowns.containsKey(Integer.valueOf(skillId))) {
            /*  9737 */
            this.coolDowns.remove(Integer.valueOf(skillId));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void removeCooldown(int skillId, boolean show) {
        /*  9742 */
        if (this.coolDowns.containsKey(Integer.valueOf(skillId))) {
            /*  9743 */
            this.coolDowns.remove(Integer.valueOf(skillId));
            /*  9744 */
            if (show) {
                /*  9745 */
                this.client.announce(MaplePacketCreator.skillCooldown(skillId, 0));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean skillisCooling(int skillId) {
        /*  9751 */
        if (this.coolDowns.containsKey(Integer.valueOf(skillId))) {
            /*  9752 */
            MapleCoolDownValueHolder mapleCoolDownValueHolder = this.coolDowns.get(Integer.valueOf(skillId));
            /*  9753 */
            return (System.currentTimeMillis() - mapleCoolDownValueHolder.startTime - mapleCoolDownValueHolder.length > 1000L);
            /*       */
        }
        /*  9755 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public void giveCoolDowns(int skillid, long starttime, long length) {
        /*  9759 */
        addCooldown(skillid, starttime, length);
        /*       */
    }

    /*       */
    /*       */
    public void giveCoolDowns(List<MapleCoolDownValueHolder> cooldowns) {
        /*  9763 */
        if (cooldowns != null) {
            /*       */
            /*  9765 */
            for (MapleCoolDownValueHolder cooldown : cooldowns) {
                /*       */
                /*       */
                /*  9768 */
                MapleStatEffect skilleffect = null;
                /*       */
                /*  9770 */
                int FirstCooldown = 0;
                /*       */
                /*  9772 */
                if ((skilleffect = getSkillEffect(cooldown.skillId)) != null) {
                    /*  9773 */
                    FirstCooldown = skilleffect.getCooldown(this) * 1000;
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*  9778 */
                long RemainTime = cooldown.startTime + FirstCooldown - System.currentTimeMillis();
                /*  9779 */
                if (RemainTime <= 0L) {
                    /*  9780 */
                    removeCooldown(cooldown.skillId);
                    /*  9781 */
                    getClient().announce(MaplePacketCreator.skillCooldown(cooldown.skillId, 0));
                    /*       */
                    continue;
                    /*       */
                }
                /*  9784 */
                giveCoolDowns(cooldown.skillId, cooldown.startTime, RemainTime);
                /*       */
            }
            /*       */
        } else {
            /*  9787 */
            try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
                /*  9788 */
                PreparedStatement ps = con.prepareStatement("SELECT SkillID,StartTime,length FROM skills_cooldowns WHERE charid = ?");
                /*  9789 */
                ps.setInt(1, getId());
                /*  9790 */
                ResultSet rs = ps.executeQuery();
                /*  9791 */
                while (rs.next()) {
                    /*       */
                    /*  9793 */
                    if (rs.getLong("length") + rs.getLong("StartTime") - System.currentTimeMillis() <= 0L) {
                        /*       */
                        continue;
                        /*       */
                    }
                    /*       */
                    /*       */
                    /*       */
                    /*  9799 */
                    giveCoolDowns(rs.getInt("SkillID"), rs.getLong("StartTime"), rs.getLong("length"));
                    /*       */
                }
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*  9807 */
                ps.close();
                /*  9808 */
                rs.close();
                /*  9809 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM skills_cooldowns WHERE charid = ?");
                /*  9810 */
            } catch (SQLException e) {
                /*  9811 */
                System.err.println("出现错误");
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getCooldownSize() {
        /*  9818 */
        return this.coolDowns.size();
        /*       */
    }

    /*       */
    /*       */
    public List<MapleCoolDownValueHolder> getCooldowns() {
        /*  9822 */
        List<MapleCoolDownValueHolder> ret = new ArrayList<>();
        /*  9823 */
        for (MapleCoolDownValueHolder mc : this.coolDowns.values()) {
            /*  9824 */
            if (mc != null) {
                /*  9825 */
                ret.add(mc);
                /*       */
            }
            /*       */
        }
        /*  9828 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<MapleDiseaseValueHolder> getAllDiseases() {
        /*  9835 */
        return new ArrayList<>(this.diseases.values());
        /*       */
    }

    /*       */
    /*       */
    public MapleDiseaseValueHolder getDiseasesValue(MapleDisease dis) {
        /*  9839 */
        return this.diseases.get(dis);
        /*       */
    }

    /*       */
    /*       */
    public boolean hasDisease(MapleDisease dis) {
        /*  9843 */
        return this.diseases.containsKey(dis);
        /*       */
    }

    /*       */
    /*       */
    public void giveDebuff(MapleDisease disease, MobSkill skill) {
        /*  9847 */
        giveDebuff(disease, skill.getX(), skill.getDuration(), skill.getSkillId(), skill.getSkillLevel());
        /*       */
    }

    /*       */
    /*       */
    public void giveDebuff(MapleDisease disease, int x, long duration, int skillid, int level) {
        /*  9851 */
        if (ServerConfig.CHANNEL_APPLYPLAYERDEBUFF) {
            /*       */
            return;
            /*       */
        }
        /*  9854 */
        if (this.map != null && !hasDisease(disease)) {
            /*  9855 */
            if (disease != MapleDisease.诱惑 && disease != MapleDisease.昏迷 &&
                    /*  9856 */         getBuffedValue(MapleBuffStat.进阶祝福) != null) {
                /*       */
                return;
                /*       */
            }
            /*       */
            /*  9860 */
            int mC = getBuffSource(MapleBuffStat.金属机甲);
            /*  9861 */
            if (mC > 0 && mC != 35111003) {
                /*       */
                return;
                /*       */
            }
            /*  9864 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.神圣保护);
            /*  9865 */
            if (effect != null) {
                /*  9866 */
                int count = getBuffedValue(MapleBuffStat.神圣保护).intValue();
                /*  9867 */
                if (count > 0) {
                    /*  9868 */
                    int newcount = count - 1;
                    /*  9869 */
                    if (newcount > 0) {
                        /*  9870 */
                        setBuffedValue(MapleBuffStat.神圣保护, newcount);
                        /*  9871 */
                        Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.神圣保护, Integer.valueOf(newcount));
                        /*  9872 */
                        this.client.announce(BuffPacket.giveBuff(effect.getSourceid(), 0, stat, effect, this));
                        /*       */
                    } else {
                        /*  9874 */
                        cancelEffectFromBuffStat(MapleBuffStat.神圣保护);
                        /*  9875 */
                        if (effect.getSourceid() == 27111004) {
                            /*  9876 */
                            this.client.announce(MaplePacketCreator.skillCooldown(effect.getSourceid(), effect.getCooldown(this)));
                            /*  9877 */
                            addCooldown(effect.getSourceid(), System.currentTimeMillis(), (effect.getCooldown(this) * 1000));
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                    return;
                    /*       */
                }
                /*  9882 */
                cancelEffectFromBuffStat(MapleBuffStat.神圣保护);
                /*  9883 */
                if (effect.getSourceid() == 27111004) {
                    /*  9884 */
                    this.client.announce(MaplePacketCreator.skillCooldown(effect.getSourceid(), effect.getCooldown(this)));
                    /*  9885 */
                    addCooldown(effect.getSourceid(), System.currentTimeMillis(), (effect.getCooldown(this) * 1000));
                    /*       */
                }
                /*       */
            }
            /*       */
            /*  9889 */
            if (this.stats.ASR > 0 && Randomizer.nextInt(100) < this.stats.ASR) {
                /*       */
                return;
                /*       */
            }
            /*  9892 */
            this.diseases.put(disease, new MapleDiseaseValueHolder(disease, skillid, level, System.currentTimeMillis(), duration - this.stats.decreaseDebuff));
            /*  9893 */
            this.client.announce(BuffPacket.giveDebuff(disease, x, skillid, level, (int) duration));
            /*  9894 */
            this.map.broadcastMessage(this, BuffPacket.giveForeignDebuff(this.id, disease, skillid, level, x), false);
            /*  9895 */
            if (x > 0 && disease == MapleDisease.中毒) {
                /*  9896 */
                addHP((int) -(x * (duration - this.stats.decreaseDebuff) / 1000L));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void giveSilentDebuff(List<MapleDiseaseValueHolder> ld) {
        /*  9905 */
        if (ld != null) {
            /*  9906 */
            for (MapleDiseaseValueHolder disease : ld) {
                /*  9907 */
                this.diseases.put(disease.disease, disease);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void dispelDebuff(MapleDisease debuff) {
        /*  9913 */
        if (hasDisease(debuff)) {
            /*  9914 */
            this.client.announce(BuffPacket.cancelDebuff(debuff));
            /*  9915 */
            this.map.broadcastMessage(this, BuffPacket.cancelForeignDebuff(this.id, debuff), false);
            /*  9916 */
            this.diseases.remove(debuff);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void dispelDebuffs() {
        /*  9921 */
        List<MapleDisease> diseasess = new ArrayList<>(this.diseases.keySet());
        /*  9922 */
        for (MapleDisease d : diseasess) {
            /*  9923 */
            dispelDebuff(d);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void cancelAllDebuffs() {
        /*  9928 */
        this.diseases.clear();
        /*       */
    }

    /*       */
    /*       */
    public int getDiseaseSize() {
        /*  9932 */
        return this.diseases.size();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void sendNote(String to, String msg) {
        /*  9939 */
        sendNote(to, msg, 0);
        /*       */
    }

    /*       */
    /*       */
    public void sendNote(String to, String msg, int fame) {
        /*  9943 */
        MapleCharacterUtil.sendNote(to, getName(), msg, fame);
        /*       */
    }

    /*       */
    /*       */
    public void showNote() {
        /*  9947 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  9948 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM notes WHERE `to`=?", 1005, 1008);
            /*  9949 */
            ps.setString(1, getName());
            /*  9950 */
            ResultSet rs = ps.executeQuery();
            /*  9951 */
            rs.last();
            /*  9952 */
            int count = rs.getRow();
            /*  9953 */
            rs.first();
            /*  9954 */
            this.client.announce(MTSCSPacket.INSTANCE.showNotes(rs, count));
            /*  9955 */
            rs.close();
            /*  9956 */
            ps.close();
            /*  9957 */
        } catch (SQLException e) {
            /*  9958 */
            System.err.println("Unable to show note" + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void deleteNote(int id, int fame) {
        /*  9963 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*  9964 */
            PreparedStatement ps = con.prepareStatement("SELECT gift FROM notes WHERE `id`=?");
            /*  9965 */
            ps.setInt(1, id);
            /*  9966 */
            ResultSet rs = ps.executeQuery();
            /*  9967 */
            if (rs.next() &&
                    /*  9968 */         rs.getInt("gift") == fame && fame > 0) {
                /*  9969 */
                addFame(fame);
                /*  9970 */
                updateSingleStat(MapleStat.人气, getFame());
                /*  9971 */
                this.client.announce(MaplePacketCreator.getShowFameGain(fame));
                /*       */
            }
            /*       */
            /*  9974 */
            rs.close();
            /*  9975 */
            ps.close();
            /*  9976 */
            ps = con.prepareStatement("DELETE FROM notes WHERE `id`=?");
            /*  9977 */
            ps.setInt(1, id);
            /*  9978 */
            ps.execute();
            /*  9979 */
            ps.close();
            /*  9980 */
        } catch (SQLException e) {
            /*  9981 */
            System.err.println("Unable to delete note" + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getMulungEnergy() {
        /*  9986 */
        return this.mulung_energy;
        /*       */
    }

    /*       */
    /*       */
    public void mulung_EnergyModify(boolean inc) {
        /*  9990 */
        if (inc) {
            /*  9991 */
            if (this.mulung_energy + 100 > 10000) {
                /*  9992 */
                this.mulung_energy = 10000;
                /*       */
            } else {
                /*  9994 */
                this.mulung_energy = (short) (this.mulung_energy + 100);
                /*       */
            }
            /*       */
        } else {
            /*  9997 */
            this.mulung_energy = 0;
            /*       */
        }
        /*  9999 */
        this.client.announce(MaplePacketCreator.MulungEnergy(this.mulung_energy));
        /*       */
    }

    /*       */
    /*       */
    public void writeMapEventEffect(String inc) {
        /* 10003 */
        this.client.announce(MaplePacketCreator.showEffect(inc));
        /*       */
    }

    /*       */
    /*       */
    public void writeMulungEnergy() {
        /* 10007 */
        this.client.announce(MaplePacketCreator.MulungEnergy(this.mulung_energy));
        /*       */
    }

    /*       */
    /*       */
    public void writeEnergy(String type, String inc) {
        /* 10011 */
        this.client.announce(MaplePacketCreator.sendPyramidEnergy(type, inc));
        /*       */
    }

    /*       */
    /*       */
    public void writeStatus(String type, String inc) {
        /* 10015 */
        this.client.announce(MaplePacketCreator.sendGhostStatus(type, inc));
        /*       */
    }

    /*       */
    /*       */
    public void writePoint(String type, String inc) {
        /* 10019 */
        this.client.announce(MaplePacketCreator.sendGhostPoint(type, inc));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getAranCombo() {
        /* 10026 */
        return this.specialStats.getAranCombo();
        /*       */
    }

    /*       */
    /*       */
    public void gainAranCombo(int count, boolean show) {
        /* 10030 */
        setAranCombo(getAranCombo() + count, show);
        /*       */
    }

    /*       */
    /*       */
    public void setAranCombo(int count, boolean show) {
        /* 10034 */
        this.specialStats.setAranCombo(Math.max(0, Math.min(30000, count)));
        /* 10035 */
        if (show) {
            /* 10036 */
            this.client.announce(MaplePacketCreator.ShowAranCombo(getAranCombo()));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public long getKeyDownSkill_Time() {
        /* 10041 */
        return this.keydown_skill;
        /*       */
    }

    /*       */
    /*       */
    public void setKeyDownSkill_Time(long keydown_skill) {
        /* 10045 */
        this.keydown_skill = keydown_skill;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkBerserk() {
        /* 10052 */
        if (this.job != 132 || this.lastBerserkTime < 0L || this.lastBerserkTime + 10000L > System.currentTimeMillis()) {
            /*       */
            return;
            /*       */
        }
        /* 10055 */
        int skillId = 1320016;
        /* 10056 */
        Skill BerserkX = SkillFactory.getSkill(skillId);
        /* 10057 */
        int skilllevel = getTotalSkillLevel(BerserkX);
        /* 10058 */
        if (skilllevel >= 1 && this.map != null) {
            /* 10059 */
            this.lastBerserkTime = System.currentTimeMillis();
            /* 10060 */
            MapleStatEffect ampStat = BerserkX.getEffect(skilllevel);
            /* 10061 */
            this.stats.Berserk = (this.stats.getHp() * 100 / this.stats.getCurrentMaxHp() >= ampStat.getX());
            /* 10062 */
            this.client.announce(EffectPacket.showOwnBuffEffect(skillId, 1, getLevel(), skilllevel, (byte) (this.stats.Berserk ? 1 : 0)));
            /* 10063 */
            this.map.broadcastMessage(this, EffectPacket.showBuffeffect(this, skillId, EffectOpcode.UserEffect_SkillUse.getValue(), getLevel(), skilllevel, (byte) (this.stats.Berserk ? 1 : 0)), false);
            /*       */
        } else {
            /* 10065 */
            this.lastBerserkTime = -1L;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void check生命潮汐() {
        /* 10073 */
        if (this.job != 2711 && this.job != 2712) {
            /*       */
            return;
            /*       */
        }
        /* 10076 */
        Skill skill = SkillFactory.getSkill(27110007);
        /* 10077 */
        int skilllevel = getTotalSkillLevel(skill);
        /* 10078 */
        MapleStatEffect effect = getStatForBuff(MapleBuffStat.生命潮汐);
        /* 10079 */
        if (skilllevel >= 1 && this.map != null && (
                /* 10080 */       effect == null || effect.getLevel() < skilllevel)) {
            /* 10081 */
            skill.getEffect(skilllevel).applyTo(this);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkBloodContract() {
        /* 10090 */
        if (!JobConstants.is恶魔复仇者(this.job)) {
            /*       */
            return;
            /*       */
        }
        /* 10093 */
        Skill skill = SkillFactory.getSkill(30010242);
        /* 10094 */
        int skilllevel = getTotalSkillLevel(skill);
        /* 10095 */
        if (skilllevel >= 1 && this.map != null) {
            /* 10096 */
            skill.getEffect(skilllevel).applyTo(this);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setMarketChalkboard(String text) {
        /* 10104 */
        if (this.map == null) {
            /*       */
            return;
            /*       */
        }
        /* 10107 */
        this.map.broadcastMessage(MTSCSPacket.INSTANCE.useChalkboard(getId(), text));
        /* 10108 */
        if (this.chalkSchedule != null) {
            /* 10109 */
            this.chalkSchedule.cancel(false);
            /* 10110 */
            this.chalkSchedule = null;
            /*       */
        }
        /* 10112 */
        this.chalkSchedule = Timer.WorldTimer.getInstance().schedule(() -> setChalkboard((String) null), 4000L);
        /*       */
    }

    /*       */
    /*       */
    public String getChalkboard() {
        /* 10116 */
        return this.chalktext;
        /*       */
    }

    /*       */
    /*       */
    public void setChalkboard(String text) {
        /* 10120 */
        this.chalktext = text;
        /* 10121 */
        if (this.map != null) {
            /* 10122 */
            this.map.broadcastMessage(MTSCSPacket.INSTANCE.useChalkboard(getId(), text));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleMount getMount() {
        /* 10127 */
        return this.mount;
        /*       */
    }

    /*       */
    /*       */
    public int[] getWishlist() {
        /* 10131 */
        return this.wishlist;
        /*       */
    }

    /*       */
    /*       */
    public void setWishlist(int[] wl) {
        /* 10135 */
        this.wishlist = wl;
        /* 10136 */
        this.changed_wishlist = true;
        /*       */
    }

    /*       */
    /*       */
    public void clearWishlist() {
        /* 10140 */
        for (int i = 0; i < 12; i++) {
            /* 10141 */
            this.wishlist[i] = 0;
            /*       */
        }
        /* 10143 */
        this.changed_wishlist = true;
        /*       */
    }

    /*       */
    /*       */
    public int getWishlistSize() {
        /* 10147 */
        int ret = 0;
        /* 10148 */
        for (int i = 0; i < 12; i++) {
            /* 10149 */
            if (this.wishlist[i] > 0) {
                /* 10150 */
                ret++;
                /*       */
            }
            /*       */
        }
        /* 10153 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public int[] getRocks() {
        /* 10157 */
        return this.rocks;
        /*       */
    }

    /*       */
    /*       */
    public int getRockSize() {
        /* 10161 */
        int ret = 0;
        /* 10162 */
        for (int i = 0; i < 10; i++) {
            /* 10163 */
            if (this.rocks[i] != 999999999) {
                /* 10164 */
                ret++;
                /*       */
            }
            /*       */
        }
        /* 10167 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void deleteFromRocks(int map) {
        /* 10171 */
        for (int i = 0; i < 10; i++) {
            /* 10172 */
            if (this.rocks[i] == map) {
                /* 10173 */
                this.rocks[i] = 999999999;
                /* 10174 */
                this.changed_trocklocations = true;
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void addRockMap() {
        /* 10181 */
        if (getRockSize() >= 10) {
            /*       */
            return;
            /*       */
        }
        /* 10184 */
        this.rocks[getRockSize()] = getMapId();
        /* 10185 */
        this.changed_trocklocations = true;
        /*       */
    }

    /*       */
    /*       */
    public boolean isRockMap(int id) {
        /* 10189 */
        for (int i = 0; i < 10; i++) {
            /* 10190 */
            if (this.rocks[i] == id) {
                /* 10191 */
                return true;
                /*       */
            }
            /*       */
        }
        /* 10194 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public int[] getRegRocks() {
        /* 10198 */
        return this.regrocks;
        /*       */
    }

    /*       */
    /*       */
    public int getRegRockSize() {
        /* 10202 */
        int ret = 0;
        /* 10203 */
        for (int i = 0; i < 5; i++) {
            /* 10204 */
            if (this.regrocks[i] != 999999999) {
                /* 10205 */
                ret++;
                /*       */
            }
            /*       */
        }
        /* 10208 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void deleteFromRegRocks(int map) {
        /* 10212 */
        for (int i = 0; i < 5; i++) {
            /* 10213 */
            if (this.regrocks[i] == map) {
                /* 10214 */
                this.regrocks[i] = 999999999;
                /* 10215 */
                this.changed_trocklocations = true;
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void addRegRockMap() {
        /* 10222 */
        if (getRegRockSize() >= 5) {
            /*       */
            return;
            /*       */
        }
        /* 10225 */
        this.regrocks[getRegRockSize()] = getMapId();
        /* 10226 */
        this.changed_trocklocations = true;
        /*       */
    }

    /*       */
    /*       */
    public boolean isRegRockMap(int id) {
        /* 10230 */
        for (int i = 0; i < 5; i++) {
            /* 10231 */
            if (this.regrocks[i] == id) {
                /* 10232 */
                return true;
                /*       */
            }
            /*       */
        }
        /* 10235 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public int[] getHyperRocks() {
        /* 10239 */
        return this.hyperrocks;
        /*       */
    }

    /*       */
    /*       */
    public int getHyperRockSize() {
        /* 10243 */
        int ret = 0;
        /* 10244 */
        for (int i = 0; i < 13; i++) {
            /* 10245 */
            if (this.hyperrocks[i] != 999999999) {
                /* 10246 */
                ret++;
                /*       */
            }
            /*       */
        }
        /* 10249 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void deleteFromHyperRocks(int map) {
        /* 10253 */
        for (int i = 0; i < 13; i++) {
            /* 10254 */
            if (this.hyperrocks[i] == map) {
                /* 10255 */
                this.hyperrocks[i] = 999999999;
                /* 10256 */
                this.changed_trocklocations = true;
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void addHyperRockMap() {
        /* 10263 */
        if (getRegRockSize() >= 13) {
            /*       */
            return;
            /*       */
        }
        /* 10266 */
        this.hyperrocks[getHyperRockSize()] = getMapId();
        /* 10267 */
        this.changed_trocklocations = true;
        /*       */
    }

    /*       */
    /*       */
    public boolean isHyperRockMap(int id) {
        /* 10271 */
        for (int i = 0; i < 13; i++) {
            /* 10272 */
            if (this.hyperrocks[i] == id) {
                /* 10273 */
                return true;
                /*       */
            }
            /*       */
        }
        /* 10276 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MaplePotionPot getPotionPot() {
        /* 10283 */
        return this.potionPot;
        /*       */
    }

    /*       */
    /*       */
    public void setPotionPot(MaplePotionPot p) {
        /* 10287 */
        this.potionPot = p;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleCoreAura getCoreAura() {
        /* 10296 */
        return this.coreAura;
        /*       */
    }

    /*       */
    /*       */
    public void updataCoreAura() {
        /* 10300 */
        if (this.coreAura != null) {
            /* 10301 */
            this.client.announce(InventoryPacket.updataCoreAura(this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dropMessage(String message) {
        /* 10311 */
        dropMessage(1, message);
        /* 10312 */
        dropMessage(5, message);
        /*       */
    }

    /*       */
    /*       */
    public void dropMessage(int type, String message) {
        /* 10316 */
        if (type == -1) {
            /* 10317 */
            this.client.announce(UIPacket.getTopMsg(message));
            /* 10318 */
        } else if (type == -2) {
            /* 10319 */
            this.client.announce(PlayerShopPacket.playerInterChat(message, 0, getName()));
            /* 10320 */
        } else if (type == -3) {
            /* 10321 */
            this.client.announce(MaplePacketCreator.getChatText(getId(), message, getName(), isSuperGM(), 0));
            /* 10322 */
        } else if (type == -4) {
            /* 10323 */
            this.client.announce(MaplePacketCreator.getChatText(getId(), message, getName(), isSuperGM(), 1));
            /* 10324 */
        } else if (type == -5) {
            /* 10325 */
            this.client.announce(MaplePacketCreator.spouseMessage(message, false));
            /* 10326 */
        } else if (type == -6) {
            /* 10327 */
            this.client.announce(MaplePacketCreator.spouseMessage(message, true));
            /* 10328 */
        } else if (type == -7) {
            /* 10329 */
            this.client.announce(UIPacket.getMidMsg(message, false, 0));
            /* 10330 */
        } else if (type == -8) {
            /* 10331 */
            this.client.announce(UIPacket.getMidMsg(message, true, 0));
            /* 10332 */
        } else if (type == -9) {
            /* 10333 */
            this.client.announce(MaplePacketCreator.showRedNotice(message));
            /* 10334 */
        } else if (type == -10) {
            /* 10335 */
            this.client.announce(MaplePacketCreator.getFollowMessage(message));
            /* 10336 */
        } else if (type == -11) {
            /* 10337 */
            this.client.announce(MaplePacketCreator.yellowChat(message));
            /* 10338 */
        } else if (type == -12) {
            /* 10339 */
            this.client.announce(UIPacket.getNpcNotice(1540488, message, 10000));
            /*       */
        } else {
            /* 10341 */
            this.client.announce(MaplePacketCreator.serverNotice(type, message));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void dropSpouseMessage(int type, String message) {
        /* 10346 */
        if (type == 0 || type == 1 || (type >= 6 && type <= 42)) {
            /* 10347 */
            this.client.announce(MaplePacketCreator.spouseMessage(type, message));
            /*       */
        } else {
            /* 10349 */
            this.client.announce(MaplePacketCreator.serverNotice(5, message));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dropDebugMessage(int type, String message) {
        /* 10360 */
        dropSpouseMessage((type == 1) ? 24 : ((type == 2) ? 26 : 35), message);
        /*       */
    }

    /*       */
    /*       */
    public IMaplePlayerShop getPlayerShop() {
        /* 10364 */
        return this.playerShop;
        /*       */
    }

    /*       */
    /*       */
    public void setPlayerShop(IMaplePlayerShop playerShop) {
        /* 10368 */
        this.playerShop = playerShop;
        /*       */
    }

    /*       */
    /*       */
    public int getConversation() {
        /* 10372 */
        return this.inst.get();
        /*       */
    }

    /*       */
    /*       */
    public void setConversation(int inst) {
        /* 10376 */
        this.inst.set(inst);
        /*       */
    }

    /*       */
    /*       */
    public void resetConversation() {
        /* 10380 */
        if (getConversation() != 0) {
            /* 10381 */
            setConversation(0);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getDirection() {
        /* 10386 */
        return this.insd.get();
        /*       */
    }

    /*       */
    /*       */
    public void setDirection(int inst) {
        /* 10390 */
        this.insd.set(inst);
        /*       */
    }

    /*       */
    /*       */
    public MapleCarnivalParty getCarnivalParty() {
        /* 10394 */
        return this.carnivalParty;
        /*       */
    }

    /*       */
    /*       */
    public void setCarnivalParty(MapleCarnivalParty party) {
        /* 10398 */
        this.carnivalParty = party;
        /*       */
    }

    /*       */
    /*       */
    public void addCP(int ammount) {
        /* 10402 */
        this.totalCP = (short) (this.totalCP + ammount);
        /* 10403 */
        this.availableCP = (short) (this.availableCP + ammount);
        /*       */
    }

    /*       */
    /*       */
    public void useCP(int ammount) {
        /* 10407 */
        this.availableCP = (short) (this.availableCP - ammount);
        /*       */
    }

    /*       */
    /*       */
    public int getAvailableCP() {
        /* 10411 */
        return this.availableCP;
        /*       */
    }

    /*       */
    /*       */
    public int getTotalCP() {
        /* 10415 */
        return this.totalCP;
        /*       */
    }

    /*       */
    /*       */
    public void resetCP() {
        /* 10419 */
        this.totalCP = 0;
        /* 10420 */
        this.availableCP = 0;
        /*       */
    }

    /*       */
    /*       */
    public void addCarnivalRequest(MapleCarnivalChallenge request) {
        /* 10424 */
        this.pendingCarnivalRequests.add(request);
        /*       */
    }

    /*       */
    /*       */
    public final MapleCarnivalChallenge getNextCarnivalRequest() {
        /* 10428 */
        return this.pendingCarnivalRequests.pollLast();
        /*       */
    }

    /*       */
    /*       */
    public void clearCarnivalRequests() {
        /* 10432 */
        this.pendingCarnivalRequests = new LinkedList<>();
        /*       */
    }

    /*       */
    /*       */
    public void startMonsterCarnival(int enemyavailable, int enemytotal) {
        /* 10436 */
        this.client.announce(MonsterCarnivalPacket.startMonsterCarnival(this, enemyavailable, enemytotal));
        /*       */
    }

    /*       */
    /*       */
    public void setAchievementFinished(int id) {
        /* 10440 */
        if (!this.finishedAchievements.contains(Integer.valueOf(id))) {
            /* 10441 */
            this.finishedAchievements.add(Integer.valueOf(id));
            /* 10442 */
            this.changed_achievements = true;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean achievementFinished(int achievementid) {
        /* 10447 */
        return this.finishedAchievements.contains(Integer.valueOf(achievementid));
        /*       */
    }

    /*       */
    /*       */
    public void finishAchievement(int id) {
        /* 10451 */
        if (!achievementFinished(id) &&
                /* 10452 */       isAlive()) {
            /* 10453 */
            MapleAchievements.getInstance().getById(id).finishAchievement(this);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public List<Integer> getFinishedAchievements() {
        /* 10459 */
        return this.finishedAchievements;
        /*       */
    }

    /*       */
    /*       */
    public boolean getCanTalk() {
        /* 10463 */
        return this.canTalk;
        /*       */
    }

    /*       */
    /*       */
    public void canTalk(boolean talk) {
        /* 10467 */
        this.canTalk = talk;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public double getEXPMod() {
        /* 10474 */
        return hasEXPCard();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public double hasEXPCard() {
        /* 10481 */
        int[] expCards = {5210000, 5210001, 5210002, 5210003, 5210004, 5210005, 5210006, 5211047, 5211060, 5211000, 5211001, 5211002, 5211063, 5211064, 5211065, 5211066, 5211069, 5211070, 5211084, 5211085, 5211108, 5211109};
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /* 10509 */
        MapleInventory iv = getInventory(MapleInventoryType.CASH);
        /* 10510 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /* 10511 */
        double canuse = 1.0D;
        int arrayOfInt1[], i;
        byte b;
        /* 10512 */
        for (arrayOfInt1 = expCards, i = arrayOfInt1.length, b = 0; b < i; ) {
            Integer ids = Integer.valueOf(arrayOfInt1[b]);
            /* 10513 */
            if (iv.countById(ids.intValue()) > 0 &&
                    /* 10514 */         ii.isExpOrDropCardTime(ids.intValue())) {
                /* 10515 */
                switch (ids.intValue()) {
                    /*       */
                    case 5210000:
                        /*       */
                    case 5210001:
                        /*       */
                    case 5210002:
                        /*       */
                    case 5210003:
                        /*       */
                    case 5210004:
                        /*       */
                    case 5210005:
                        /*       */
                    case 5210006:
                        /*       */
                    case 5211000:
                        /*       */
                    case 5211001:
                        /*       */
                    case 5211002:
                        /*       */
                    case 5211047:
                        /*       */
                    case 5211084:
                        /*       */
                    case 5211085:
                        /*       */
                    case 5211108:
                        /*       */
                    case 5211109:
                        /* 10531 */
                        canuse = 2.0D;
                        /*       */
                        break;
                    /*       */
                    case 5211060:
                        /* 10534 */
                        canuse = 3.0D;
                        /*       */
                        break;
                    /*       */
                    case 5211063:
                        /*       */
                    case 5211064:
                        /*       */
                    case 5211065:
                        /*       */
                    case 5211066:
                        /*       */
                    case 5211069:
                        /*       */
                    case 5211070:
                        /* 10542 */
                        canuse = 1.5D;
                        /*       */
                        break;
                    /*       */
                }
                /*       */
            }
            /*       */
            b++;
        }
        /*       */
        /* 10548 */
        return canuse;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getDropMod() {
        /* 10555 */
        return hasDropCard();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int hasDropCard() {
        /* 10562 */
        int[] dropCards = {5360000, 5360014, 5360015, 5360016};
        /* 10563 */
        MapleInventory iv = getInventory(MapleInventoryType.CASH);
        /* 10564 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        int arrayOfInt1[], i;
        byte b;
        /* 10565 */
        for (arrayOfInt1 = dropCards, i = arrayOfInt1.length, b = 0; b < i; ) {
            Integer id3 = Integer.valueOf(arrayOfInt1[b]);
            /* 10566 */
            if (iv.countById(id3.intValue()) > 0 &&
                    /* 10567 */         ii.isExpOrDropCardTime(id3.intValue())) {
                /* 10568 */
                return 2;
                /*       */
            }
            /*       */
            b++;
        }
        /*       */
        /* 10572 */
        return 1;
        /*       */
    }

    /*       */
    /*       */
    public int getCashMod() {
        /* 10576 */
        return this.stats.cashMod;
        /*       */
    }

    /*       */
    /*       */
    public int getACash() {
        /* 10580 */
        return getClient().getACash();
        /*       */
    }

    /*       */
    /*       */
    public void setACash(int point) {
        /* 10584 */
        getClient().setACash(point);
        /* 10585 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public int getMaplePoints() {
        /* 10589 */
        return getClient().getMaplePoints();
        /*       */
    }

    /*       */
    /*       */
    public void setMaplePoints(int point) {
        /* 10593 */
        getClient().setMaplePoints(point);
        /* 10594 */
        this.playerObservable.update();
        /*       */
    }

    /*       */
    /*       */
    public int getPoints() {
        /* 10598 */
        return this.points;
        /*       */
    }

    /*       */
    /*       */
    public void setPoints(int p) {
        /* 10602 */
        this.points = p;
        /* 10603 */
        if (this.points >= 1) {
            /* 10604 */
            finishAchievement(1);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getVPoints() {
        /* 10609 */
        return this.vpoints;
        /*       */
    }

    /*       */
    /*       */
    public void setVPoints(int p) {
        /* 10613 */
        this.vpoints = p;
        /*       */
    }

    /*       */
    /*       */
    public CashShop getCashInventory() {
        /* 10617 */
        return this.cs;
        /*       */
    }

    /*       */
    /*       */
    public void removeItem(int id, int quantity) {
        /* 10621 */
        MapleInventoryManipulator.removeById(this.client, ItemConstants.getInventoryType(id), id, quantity, true, false);
        /* 10622 */
        this.client.announce(MaplePacketCreator.getShowItemGain(id, (short) -quantity, true));
        /*       */
    }

    /*       */
    /*       */
    public void removeAll(int id) {
        /* 10626 */
        removeAll(id, true, false);
        /*       */
    }

    /*       */
    /*       */
    public void removeAll(int itemId, boolean show, boolean checkEquipped) {
        /* 10630 */
        MapleInventoryType type = ItemConstants.getInventoryType(itemId);
        /* 10631 */
        int possessed = getInventory(type).countById(itemId);
        /* 10632 */
        if (possessed > 0) {
            /* 10633 */
            MapleInventoryManipulator.removeById(getClient(), type, itemId, possessed, true, false);
            /* 10634 */
            if (show) {
                /* 10635 */
                getClient().announce(MaplePacketCreator.getShowItemGain(itemId, (short) -possessed, true));
                /*       */
            }
            /*       */
        }
        /* 10638 */
        if (checkEquipped && type == MapleInventoryType.EQUIP) {
            /* 10639 */
            type = MapleInventoryType.EQUIPPED;
            /* 10640 */
            possessed = getInventory(type).countById(itemId);
            /* 10641 */
            if (possessed > 0) {
                /* 10642 */
                MapleInventoryManipulator.removeById(getClient(), type, itemId, possessed, true, false);
                /* 10643 */
                if (show) {
                    /* 10644 */
                    getClient().announce(MaplePacketCreator.getShowItemGain(itemId, (short) -possessed, true));
                    /*       */
                }
                /* 10646 */
                equipChanged();
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void removeItem(int itemId) {
        /* 10652 */
        removeItem(itemId, false);
        /*       */
    }

    /*       */
    /*       */
    public void removeItem(int itemId, boolean show) {
        /* 10656 */
        MapleInventoryType type = ItemConstants.getInventoryType(itemId);
        /* 10657 */
        if (type == MapleInventoryType.EQUIP) {
            /* 10658 */
            type = MapleInventoryType.EQUIPPED;
            /* 10659 */
            int possessed = getInventory(type).countById(itemId);
            /* 10660 */
            if (possessed > 0) {
                /* 10661 */
                MapleInventoryManipulator.removeById(getClient(), type, itemId, possessed, true, false);
                /* 10662 */
                if (show) {
                    /* 10663 */
                    getClient().announce(MaplePacketCreator.getShowItemGain(itemId, (short) -possessed, true));
                    /*       */
                }
                /* 10665 */
                equipChanged();
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MapleRing getMarriageRing() {
        /* 10671 */
        MapleInventory iv = getInventory(MapleInventoryType.EQUIPPED);
        /* 10672 */
        List<Item> equipped = iv.newList();
        /* 10673 */
        Collections.sort(equipped);
        /* 10674 */
        MapleRing mrings = null;
        /* 10675 */
        for (Item ite : equipped) {
            /* 10676 */
            Equip item = (Equip) ite;
            /* 10677 */
            if (item.getRing() != null) {
                /* 10678 */
                MapleRing ring = item.getRing();
                /* 10679 */
                ring.setEquipped(true);
                /* 10680 */
                if (mrings == null && ItemConstants.is结婚戒指(item.getItemId())) {
                    /* 10681 */
                    mrings = ring;
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 10685 */
        if (mrings == null) {
            /* 10686 */
            iv = getInventory(MapleInventoryType.EQUIP);
            /* 10687 */
            for (Item ite : iv.list()) {
                /* 10688 */
                Equip item = (Equip) ite;
                /* 10689 */
                if (item.getRing() != null) {
                    /* 10690 */
                    MapleRing ring = item.getRing();
                    /* 10691 */
                    ring.setEquipped(false);
                    /* 10692 */
                    if (mrings == null && ItemConstants.is结婚戒指(item.getItemId())) {
                        /* 10693 */
                        mrings = ring;
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 10698 */
        return mrings;
        /*       */
    }

    /*       */
    /*       */
    public Triple<List<MapleRing>, List<MapleRing>, List<MapleRing>> getRings(boolean equip) {
        /* 10702 */
        MapleInventory iv = getInventory(MapleInventoryType.EQUIPPED);
        /* 10703 */
        List<Item> equipped = iv.newList();
        /* 10704 */
        Collections.sort(equipped);
        /* 10705 */
        List<MapleRing> crings = new ArrayList<>(), frings = new ArrayList<>(), mrings = new ArrayList<>();
        /*       */
        /* 10707 */
        for (Item ite : equipped) {
            /* 10708 */
            Equip item = (Equip) ite;
            /* 10709 */
            if (item.getRing() != null && ItemConstants.isEffectRing(item.getItemId())) {
                /* 10710 */
                MapleRing ring = item.getRing();
                /* 10711 */
                ring.setEquipped(true);
                /* 10712 */
                if (equip) {
                    /* 10713 */
                    if (ItemConstants.is恋人戒指(item.getItemId())) {
                        /* 10714 */
                        crings.add(ring);
                        continue;
                        /* 10715 */
                    }
                    if (ItemConstants.is好友戒指(item.getItemId())) {
                        /* 10716 */
                        frings.add(ring);
                        continue;
                        /* 10717 */
                    }
                    if (ItemConstants.is结婚戒指(item.getItemId()))
                        /* 10718 */ mrings.add(ring);
                    continue;
                    /*       */
                }
                /* 10720 */
                if (crings.isEmpty() && ItemConstants.is恋人戒指(item.getItemId())) {
                    /* 10721 */
                    crings.add(ring);
                    continue;
                    /* 10722 */
                }
                if (frings.isEmpty() && ItemConstants.is好友戒指(item.getItemId())) {
                    /* 10723 */
                    frings.add(ring);
                    continue;
                    /* 10724 */
                }
                if (mrings.isEmpty() && ItemConstants.is结婚戒指(item.getItemId())) {
                    /* 10725 */
                    mrings.add(ring);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 10729 */
        if (equip) {
            /* 10730 */
            iv = getInventory(MapleInventoryType.EQUIP);
            /* 10731 */
            for (Item ite : iv.list()) {
                /* 10732 */
                Equip item = (Equip) ite;
                /* 10733 */
                if (item.getRing() != null && ItemConstants.isEffectRing(item.getItemId())) {
                    /* 10734 */
                    MapleRing ring = item.getRing();
                    /* 10735 */
                    ring.setEquipped(false);
                    /* 10736 */
                    if (ItemConstants.is恋人戒指(item.getItemId())) {
                        /* 10737 */
                        crings.add(ring);
                        continue;
                        /* 10738 */
                    }
                    if (ItemConstants.is好友戒指(item.getItemId())) {
                        /* 10739 */
                        frings.add(ring);
                        continue;
                        /* 10740 */
                    }
                    if (ItemConstants.is结婚戒指(item.getItemId())) {
                        /* 10741 */
                        mrings.add(ring);
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 10746 */
        frings.sort((Comparator<? super MapleRing>) new MapleRing.RingComparator());
        /* 10747 */
        crings.sort((Comparator<? super MapleRing>) new MapleRing.RingComparator());
        /* 10748 */
        mrings.sort((Comparator<? super MapleRing>) new MapleRing.RingComparator());
        /* 10749 */
        return new Triple(crings, frings, mrings);
        /*       */
    }

    /*       */
    /*       */
    public int getFH() {
        /* 10753 */
        MapleFoothold fh = getMap().getFootholds().findBelow(getTruePosition(), true);
        /* 10754 */
        if (fh != null) {
            /* 10755 */
            return fh.getId();
            /*       */
        }
        /* 10757 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public void startFairySchedule(boolean exp) {
        /* 10761 */
        startFairySchedule(exp, false);
        /*       */
    }

    /*       */
    /*       */
    public void startFairySchedule(boolean exp, boolean equipped) {
        /* 10765 */
        cancelFairySchedule((exp || this.stats.equippedFairy == 0));
        /* 10766 */
        if (this.fairyExp <= 0) {
            /* 10767 */
            this.fairyExp = (byte) this.stats.equippedFairy;
            /*       */
        }
        /* 10769 */
        if (equipped && this.fairyExp < this.stats.equippedFairy * 3 && this.stats.equippedFairy > 0) {
            /* 10770 */
            dropMessage(5, "您装备了精灵吊坠在1小时后经验获取将增加到 " + (this.fairyExp + this.stats.equippedFairy) + " %.");
            /*       */
        }
        /* 10772 */
        this.lastFairyTime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    public boolean canFairy(long now) {
        /* 10776 */
        return (this.lastFairyTime > 0L && this.lastFairyTime + 3600000L < now);
        /*       */
    }

    /*       */
    /*       */
    public boolean canHP(long now) {
        /* 10780 */
        if (this.lastHPTime + 5000L < now) {
            /* 10781 */
            this.lastHPTime = now;
            /* 10782 */
            return true;
            /*       */
        }
        /* 10784 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public boolean canMP(long now) {
        /* 10788 */
        if (this.lastMPTime + 5000L < now) {
            /* 10789 */
            this.lastMPTime = now;
            /* 10790 */
            return true;
            /*       */
        }
        /* 10792 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public boolean canHPRecover(long now) {
        /* 10796 */
        if (this.stats.hpRecoverTime > 0 && this.lastHPTime + this.stats.hpRecoverTime < now) {
            /* 10797 */
            this.lastHPTime = now;
            /* 10798 */
            return true;
            /*       */
        }
        /* 10800 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public boolean canMPRecover(long now) {
        /* 10804 */
        if (this.stats.mpRecoverTime > 0 && this.lastMPTime + this.stats.mpRecoverTime < now) {
            /* 10805 */
            this.lastMPTime = now;
            /* 10806 */
            return true;
            /*       */
        }
        /* 10808 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public void cancelFairySchedule(boolean exp) {
        /* 10812 */
        this.lastFairyTime = 0L;
        /* 10813 */
        if (exp) {
            /* 10814 */
            this.fairyExp = 0;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void doFairy() {
        /* 10819 */
        if (this.fairyExp < this.stats.equippedFairy * 3 && this.stats.equippedFairy > 0) {
            /* 10820 */
            this.fairyExp = (byte) (this.fairyExp + this.stats.equippedFairy);
            /* 10821 */
            dropMessage(5, "精灵吊坠经验获取增加到 " + this.fairyExp + " %.");
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /*       */
        /* 10827 */
        ((MapleTrait) this.traits.get(MapleTraitType.will)).addExp(5, this);
        /* 10828 */
        startFairySchedule(false, true);
        /*       */
    }

    /*       */
    /*       */
    public byte getFairyExp() {
        /* 10832 */
        return this.fairyExp;
        /*       */
    }

    /*       */
    /*       */
    public int getTeam() {
        /* 10836 */
        return this.coconutteam;
        /*       */
    }

    /*       */
    /*       */
    public void setTeam(int v) {
        /* 10840 */
        this.coconutteam = v;
        /*       */
    }

    /*       */
    /*       */
    public void clearLinkMid() {
        /* 10844 */
        this.linkMobs.clear();
        /* 10845 */
        cancelEffectFromBuffStat(MapleBuffStat.导航辅助);
        /* 10846 */
        cancelEffectFromBuffStat(MapleBuffStat.神秘瞄准术);
        /*       */
    }

    /*       */
    /*       */
    public int getFirstLinkMid() {
        /* 10850 */
        Iterator<Integer> iterator = this.linkMobs.keySet().iterator();
        if (iterator.hasNext()) {
            Integer lm = iterator.next();
            /* 10851 */
            return lm.intValue();
        }
        /*       */
        /* 10853 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, Integer> getAllLinkMid() {
        /* 10857 */
        return this.linkMobs;
        /*       */
    }

    /*       */
    /*       */
    public void setLinkMid(int lm, int x) {
        /* 10861 */
        this.linkMobs.put(Integer.valueOf(lm), Integer.valueOf(x));
        /*       */
    }

    /*       */
    /*       */
    public int getDamageIncrease(int lm) {
        /* 10865 */
        if (this.linkMobs.containsKey(Integer.valueOf(lm))) {
            /* 10866 */
            return ((Integer) this.linkMobs.get(Integer.valueOf(lm))).intValue();
            /*       */
        }
        /* 10868 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public MapleExtractor getExtractor() {
        /* 10872 */
        return this.extractor;
        /*       */
    }

    /*       */
    /*       */
    public void setExtractor(MapleExtractor me) {
        /* 10876 */
        removeExtractor();
        /* 10877 */
        this.extractor = me;
        /*       */
    }

    /*       */
    /*       */
    public void removeExtractor() {
        /* 10881 */
        if (this.extractor != null) {
            /* 10882 */
            this.map.broadcastMessage(MaplePacketCreator.removeExtractor(this.id));
            /* 10883 */
            this.map.removeMapObject((MapleMapObject) this.extractor);
            /* 10884 */
            this.extractor = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void spawnSavedPets() {
        /* 10889 */
        for (short aPetStore : this.petStore) {
            /* 10890 */
            if (aPetStore > -1) {
                /* 10891 */
                spawnPet(aPetStore, false, false);
                /*       */
            }
            /*       */
        }
        /* 10894 */
        this.petStore = new short[]{-1, -1, -1};
        /*       */
    }

    /*       */
    /*       */
    public short[] getPetStores() {
        /* 10898 */
        return this.petStore;
        /*       */
    }

    /*       */
    /*       */
    public Event_PyramidSubway getPyramidSubway() {
        /* 10902 */
        return this.pyramidSubway;
        /*       */
    }

    /*       */
    /*       */
    public void setPyramidSubway(Event_PyramidSubway ps) {
        /* 10906 */
        this.pyramidSubway = ps;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public byte getSubcategory() {
        /* 10933 */
        return this.subcategory;
        /*       */
    }

    /*       */
    /*       */
    public void setSubcategory(int z) {
        /* 10937 */
        this.subcategory = (byte) z;
        /*       */
    }

    /*       */
    /*       */
    public int itemQuantity(int itemid) {
        /* 10941 */
        return getInventory(ItemConstants.getInventoryType(itemid)).countById(itemid);
        /*       */
    }

    /*       */
    /*       */
    public RockPaperScissors getRPS() {
        /* 10945 */
        return this.rps;
        /*       */
    }

    /*       */
    /*       */
    public void setRPS(RockPaperScissors rps) {
        /* 10949 */
        this.rps = rps;
        /*       */
    }

    /*       */
    /*       */
    public long getNextConsume() {
        /* 10953 */
        return this.nextConsume;
        /*       */
    }

    /*       */
    /*       */
    public void setNextConsume(long nc) {
        /* 10957 */
        this.nextConsume = nc;
        /*       */
    }

    /*       */
    /*       */
    public int getRank() {
        /* 10961 */
        return this.rank;
        /*       */
    }

    /*       */
    /*       */
    public int getRankMove() {
        /* 10965 */
        return this.rankMove;
        /*       */
    }

    /*       */
    /*       */
    public int getJobRank() {
        /* 10969 */
        return this.jobRank;
        /*       */
    }

    /*       */
    /*       */
    public int getJobRankMove() {
        /* 10973 */
        return this.jobRankMove;
        /*       */
    }

    /*       */
    /*       */
    public void changeChannel(int channel) {
        ChannelServer toch = ChannelServer.getInstance(channel);
        if (channel != this.client.getChannel() && toch != null && !toch.isShutdown()) {
            this.changeRemoval();
            ChannelServer ch = ChannelServer.getInstance(this.client.getChannel());
            if (this.getMessenger() != null) {
                WorldMessengerService.getInstance().silentLeaveMessenger(this.getMessenger().getId(), new MapleMessengerCharacter(this));
            }

            PlayerBuffStorage.addBuffsToStorage(this.getId(), this.getAllBuffs());
            PlayerBuffStorage.addCooldownsToStorage(this.getId(), this.getCooldowns());
            PlayerBuffStorage.addDiseaseToStorage(this.getId(), this.getAllDiseases());
            CharacterTransfer ct = new CharacterTransfer(this, channel);
            World.ChannelChange_Data(ct, this.getId(), channel);
            ch.removePlayer(this);
            this.client.updateLoginState(3, this.client.getSessionIPAddress());
            this.client.announce(MaplePacketCreator.getChannelChange(this.client, toch.getPort()));
            this.saveToDB(false, false);
            this.getMap().removePlayer(this);
            this.client.setPlayer((MapleCharacter)null);
            this.client.setReceiving(false);
        } else {
            this.client.announce(MaplePacketCreator.serverBlocked(1));
        }
    }


    /*       */
    /*       */
    public void expandInventory(byte type, int amount) {
        /* 11011 */
        MapleInventory inv = getInventory(MapleInventoryType.getByType(type));
        /* 11012 */
        inv.addSlot((short) (byte) amount);
        /* 11013 */
        this.client.announce(InventoryPacket.updateInventorySlotLimit(type, (byte) inv.getSlotLimit()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean allowedToTarget(MapleCharacter other) {
        /* 11023 */
        return (other != null && (!other.isHidden() || getGMLevel() >= other.getGMLevel()));
        /*       */
    }

    /*       */
    /*       */
    public int getFollowId() {
        /* 11027 */
        return this.followid;
        /*       */
    }

    /*       */
    /*       */
    public void setFollowId(int fi) {
        /* 11031 */
        this.followid = fi;
        /* 11032 */
        if (fi == 0) {
            /* 11033 */
            this.followinitiator = false;
            /* 11034 */
            this.followon = false;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean isFollowOn() {
        /* 11039 */
        return this.followon;
        /*       */
    }

    /*       */
    /*       */
    public void setFollowOn(boolean fi) {
        /* 11043 */
        this.followon = fi;
        /*       */
    }

    /*       */
    /*       */
    public boolean isFollowInitiator() {
        /* 11047 */
        return this.followinitiator;
        /*       */
    }

    /*       */
    /*       */
    public void setFollowInitiator(boolean fi) {
        /* 11051 */
        this.followinitiator = fi;
        /*       */
    }

    /*       */
    /*       */
    public void checkFollow() {
        /* 11055 */
        if (this.followid <= 0) {
            /*       */
            return;
            /*       */
        }
        /* 11058 */
        if (this.followon) {
            /* 11059 */
            this.map.broadcastMessage(MaplePacketCreator.followEffect(this.id, 0, null));
            /* 11060 */
            this.map.broadcastMessage(MaplePacketCreator.followEffect(this.followid, 0, null));
            /*       */
        }
        /* 11062 */
        MapleCharacter tt = this.map.getCharacterById(this.followid);
        /* 11063 */
        this.client.announce(MaplePacketCreator.getFollowMessage("已停止跟随。"));
        /* 11064 */
        if (tt != null) {
            /* 11065 */
            tt.setFollowId(0);
            /* 11066 */
            tt.getClient().announce(MaplePacketCreator.getFollowMessage("已停止跟随。"));
            /*       */
        }
        /* 11068 */
        setFollowId(0);
        /*       */
    }

    /*       */
    /*       */
    public int getMarriageId() {
        /* 11072 */
        return this.marriageId;
        /*       */
    }

    /*       */
    /*       */
    public void setMarriageId(int mi) {
        /* 11076 */
        this.marriageId = mi;
        /*       */
    }

    /*       */
    /*       */
    public int getMarriageItemId() {
        /* 11080 */
        return this.marriageItemId;
        /*       */
    }

    /*       */
    /*       */
    public void setMarriageItemId(int mi) {
        /* 11084 */
        this.marriageItemId = mi;
        /*       */
    }

    /*       */
    /*       */
    public boolean isStaff() {
        /* 11088 */
        return (this.gmLevel >= PlayerGMRank.INTERN.getLevel());
        /*       */
    }

    /*       */
    /*       */
    public boolean isDonator() {
        /* 11092 */
        return (this.gmLevel >= PlayerGMRank.DONATOR.getLevel());
        /*       */
    }

    /*       */
    /*       */
    public boolean startPartyQuest(int questid) {
        /* 11096 */
        boolean ret = false;
        /* 11097 */
        MapleQuest q = MapleQuest.getInstance(questid);
        /* 11098 */
        if (q == null || !q.isPartyQuest()) {
            /* 11099 */
            return false;
            /*       */
        }
        /* 11101 */
        if (!this.quests.containsKey(Integer.valueOf(questid)) || !this.questinfo.containsKey(Integer.valueOf(questid))) {
            /* 11102 */
            MapleQuestStatus status = getQuestNAdd(q);
            /* 11103 */
            status.setStatus((byte) 1);
            /* 11104 */
            updateQuest(status);
            /* 11105 */
            switch (questid) {
                /*       */
                case 1300:
                    /*       */
                case 1301:
                    /*       */
                case 1302:
                    /* 11109 */
                    updateInfoQuest(questid, "min=0;sec=0;date=0000-00-00;have=0;rank=F;try=0;cmp=0;CR=0;VR=0;gvup=0;vic=0;lose=0;draw=0");
                    /*       */
                    break;
                /*       */
                case 1303:
                    /* 11112 */
                    updateInfoQuest(questid, "min=0;sec=0;date=0000-00-00;have=0;have1=0;rank=F;try=0;cmp=0;CR=0;VR=0;vic=0;lose=0");
                    /*       */
                    break;
                /*       */
                case 1204:
                    /* 11115 */
                    updateInfoQuest(questid, "min=0;sec=0;date=0000-00-00;have0=0;have1=0;have2=0;have3=0;rank=F;try=0;cmp=0;CR=0;VR=0");
                    /*       */
                    break;
                /*       */
                case 1206:
                    /* 11118 */
                    updateInfoQuest(questid, "min=0;sec=0;date=0000-00-00;have0=0;have1=0;rank=F;try=0;cmp=0;CR=0;VR=0");
                    /*       */
                    break;
                /*       */
                default:
                    /* 11121 */
                    updateInfoQuest(questid, "min=0;sec=0;date=0000-00-00;have=0;rank=F;try=0;cmp=0;CR=0;VR=0");
                    /*       */
                    break;
                /*       */
            }
            /* 11124 */
            ret = true;
            /*       */
        }
        /* 11126 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public String getOneInfo(int questid, String key) {
        /* 11130 */
        if (!this.questinfo.containsKey(Integer.valueOf(questid)) || key == null || MapleQuest.getInstance(questid) == null) {
            /* 11131 */
            return null;
            /*       */
        }
        /* 11133 */
        String[] split = ((String) this.questinfo.get(Integer.valueOf(questid))).split(";");
        /* 11134 */
        for (String x : split) {
            /* 11135 */
            String[] split2 = x.split("=");
            /* 11136 */
            if (split2.length == 2 && split2[0].equals(key)) {
                /* 11137 */
                return split2[1];
                /*       */
            }
            /*       */
        }
        /* 11140 */
        return null;
        /*       */
    }

    /*       */
    /*       */
    public void updateOneQuestInfo(int questid, String key, String value) {
        /* 11144 */
        updateOneInfo(questid, key, value);
        /*       */
    }

    /*       */
    /*       */
    public void updateOneInfo(int questid, String key, String value) {
        /* 11148 */
        if (key == null || value == null || MapleQuest.getInstance(questid) == null) {
            /*       */
            return;
            /*       */
        }
        /* 11151 */
        if (!this.questinfo.containsKey(Integer.valueOf(questid))) {
            /* 11152 */
            this.questinfo.put(Integer.valueOf(questid), key + "=" + value);
            /* 11153 */
            updateInfoQuest(questid, key + "=" + value);
            /*       */
            return;
            /*       */
        }
        /* 11156 */
        String[] split = ((String) this.questinfo.get(Integer.valueOf(questid))).split(";");
        /* 11157 */
        boolean changed = false;
        /* 11158 */
        StringBuilder newQuest = new StringBuilder();
        /* 11159 */
        for (String x : split) {
            /* 11160 */
            String[] split2 = x.split("=");
            /* 11161 */
            if (split2.length == 2) {
                /*       */
                /*       */
                /* 11164 */
                if (split2[0].equals(key)) {
                    /* 11165 */
                    newQuest.append(key).append("=").append(value);
                    /* 11166 */
                    changed = true;
                    /*       */
                } else {
                    /* 11168 */
                    newQuest.append(x);
                    /*       */
                }
                /* 11170 */
                newQuest.append(";");
                /*       */
            }
            /* 11172 */
        }
        if (!changed) {
            /* 11173 */
            newQuest.append(key).append("=").append(value);
            /*       */
        }
        /* 11175 */
        updateInfoQuest(questid, changed ? newQuest.toString().substring(0, newQuest.toString().length() - 1) : newQuest.toString());
        /*       */
    }

    /*       */
    /*       */
    public void recalcPartyQuestRank(int questid) {
        /* 11179 */
        if (MapleQuest.getInstance(questid) == null || !MapleQuest.getInstance(questid).isPartyQuest()) {
            /*       */
            return;
            /*       */
        }
        /* 11182 */
        if (!startPartyQuest(questid)) {
            /* 11183 */
            String newRank, oldRank = getOneInfo(questid, "rank");
            /* 11184 */
            if (oldRank == null || oldRank.equals("S")) {
                /*       */
                return;
                /*       */
            }
            /*       */
            /* 11188 */
            switch (oldRank) {
                /*       */
                case "A":
                    /* 11190 */
                    newRank = "S";
                    /*       */
                    break;
                /*       */
                case "B":
                    /* 11193 */
                    newRank = "A";
                    /*       */
                    break;
                /*       */
                case "C":
                    /* 11196 */
                    newRank = "B";
                    /*       */
                    break;
                /*       */
                case "D":
                    /* 11199 */
                    newRank = "C";
                    /*       */
                    break;
                /*       */
                case "F":
                    /* 11202 */
                    newRank = "D";
                    /*       */
                    break;
                /*       */
                default:
                    /*       */
                    return;
                /*       */
            }
            /* 11207 */
            List<Pair<String, Pair<String, Integer>>> questInfo = MapleQuest.getInstance(questid).getInfoByRank(newRank);
            /* 11208 */
            if (questInfo == null) {
                /*       */
                return;
                /*       */
            }
            /* 11211 */
            for (Pair<String, Pair<String, Integer>> q : questInfo) {
                /* 11212 */
                int vall;
                boolean found = false;
                /* 11213 */
                String val = getOneInfo(questid, (String) ((Pair) q.right).left);
                /* 11214 */
                if (val == null) {
                    /*       */
                    return;
                    /*       */
                }
                /*       */
                /*       */
                try {
                    /* 11219 */
                    vall = Integer.parseInt(val);
                    /* 11220 */
                } catch (NumberFormatException e) {
                    /*       */
                    return;
                    /*       */
                }
                /* 11223 */
                switch ((String) q.left) {
                    /*       */
                    case "less":
                        /* 11225 */
                        found = (vall < ((Integer) ((Pair) q.right).right).intValue());
                        /*       */
                        break;
                    /*       */
                    case "more":
                        /* 11228 */
                        found = (vall > ((Integer) ((Pair) q.right).right).intValue());
                        /*       */
                        break;
                    /*       */
                    case "equal":
                        /* 11231 */
                        found = (vall == ((Integer) ((Pair) q.right).right).intValue());
                        /*       */
                        break;
                    /*       */
                }
                /* 11234 */
                if (!found) {
                    /*       */
                    return;
                    /*       */
                }
                /*       */
            }
            /* 11238 */
            updateOneInfo(questid, "rank", newRank);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void tryPartyQuest(int questid) {
        /* 11243 */
        if (MapleQuest.getInstance(questid) == null || !MapleQuest.getInstance(questid).isPartyQuest()) {
            /*       */
            return;
            /*       */
        }
        /*       */
        try {
            /* 11247 */
            startPartyQuest(questid);
            /* 11248 */
            this.pqStartTime = System.currentTimeMillis();
            /* 11249 */
            updateOneInfo(questid, "try", String.valueOf(Integer.parseInt(getOneInfo(questid, "try")) + 1));
            /* 11250 */
        } catch (Exception e) {
            /* 11251 */
            System.out.println("tryPartyQuest error");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void endPartyQuest(int questid) {
        /* 11256 */
        if (MapleQuest.getInstance(questid) == null || !MapleQuest.getInstance(questid).isPartyQuest()) {
            /*       */
            return;
            /*       */
        }
        /*       */
        try {
            /* 11260 */
            startPartyQuest(questid);
            /* 11261 */
            if (this.pqStartTime > 0L) {
                /* 11262 */
                long changeTime = System.currentTimeMillis() - this.pqStartTime;
                /* 11263 */
                int mins = (int) (changeTime / 1000L / 60L), secs = (int) (changeTime / 1000L % 60L);
                /* 11264 */
                int mins2 = Integer.parseInt(getOneInfo(questid, "min"));
                /* 11265 */
                if (mins2 <= 0 || mins < mins2) {
                    /* 11266 */
                    updateOneInfo(questid, "min", String.valueOf(mins));
                    /* 11267 */
                    updateOneInfo(questid, "sec", String.valueOf(secs));
                    /* 11268 */
                    updateOneInfo(questid, "date", DateUtil.getCurrentDate());
                    /*       */
                }
                /* 11270 */
                int newCmp = Integer.parseInt(getOneInfo(questid, "cmp")) + 1;
                /* 11271 */
                updateOneInfo(questid, "cmp", String.valueOf(newCmp));
                /* 11272 */
                updateOneInfo(questid, "CR", String.valueOf((int) Math.ceil(newCmp * 100.0D / Integer.parseInt(getOneInfo(questid, "try")))));
                /* 11273 */
                recalcPartyQuestRank(questid);
                /* 11274 */
                this.pqStartTime = 0L;
                /*       */
            }
            /* 11276 */
        } catch (Exception e) {
            /* 11277 */
            System.out.println("endPartyQuest error");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void havePartyQuest(int itemId) {
        /* 11282 */
        int questid, index = -1;
        /* 11283 */
        switch (itemId) {
            /*       */
            case 1002798:
                /* 11285 */
                questid = 1200;
                /*       */
                break;
            /*       */
            case 1072369:
                /* 11288 */
                questid = 1201;
                /*       */
                break;
            /*       */
            case 1022073:
                /* 11291 */
                questid = 1202;
                /*       */
                break;
            /*       */
            case 1082232:
                /* 11294 */
                questid = 1203;
                /*       */
                break;
            /*       */
            case 1002571:
                /*       */
            case 1002572:
                /*       */
            case 1002573:
                /*       */
            case 1002574:
                /* 11300 */
                questid = 1204;
                /* 11301 */
                index = itemId - 1002571;
                /*       */
                break;
            /*       */
            case 1102226:
                /* 11304 */
                questid = 1303;
                /*       */
                break;
            /*       */
            case 1102227:
                /* 11307 */
                questid = 1303;
                /* 11308 */
                index = 0;
                /*       */
                break;
            /*       */
            case 1122010:
                /* 11311 */
                questid = 1205;
                /*       */
                break;
            /*       */
            case 1032060:
                /*       */
            case 1032061:
                /* 11315 */
                questid = 1206;
                /* 11316 */
                index = itemId - 1032060;
                /*       */
                break;
            /*       */
            case 3010018:
                /* 11319 */
                questid = 1300;
                /*       */
                break;
            /*       */
            case 1122007:
                /* 11322 */
                questid = 1301;
                /*       */
                break;
            /*       */
            case 1122058:
                /* 11325 */
                questid = 1302;
                /*       */
                break;
            /*       */
            default:
                /*       */
                return;
            /*       */
        }
        /* 11330 */
        if (MapleQuest.getInstance(questid) == null || !MapleQuest.getInstance(questid).isPartyQuest()) {
            /*       */
            return;
            /*       */
        }
        /* 11333 */
        startPartyQuest(questid);
        /* 11334 */
        updateOneInfo(questid, "have" + ((index == -1) ? "" : Integer.valueOf(index)+""), "1");
        /*       */
    }

    /*       */
    /*       */
    public boolean hasSummon() {
        /* 11338 */
        return this.hasSummon;
        /*       */
    }

    /*       */
    /*       */
    public void setHasSummon(boolean summ) {
        /* 11342 */
        this.hasSummon = summ;
        /*       */
    }

    /*       */
    /*       */
    public void removeDoor() {
        /* 11346 */
        MapleDoor door = getDoors().iterator().next();
        /* 11347 */
        for (MapleCharacter chr : door.getTarget().getCharactersThreadsafe()) {
            /* 11348 */
            door.sendDestroyData(chr.getClient());
            /*       */
        }
        /* 11350 */
        for (MapleCharacter chr : door.getTown().getCharactersThreadsafe()) {
            /* 11351 */
            door.sendDestroyData(chr.getClient());
            /*       */
        }
        /* 11353 */
        for (MapleDoor destroyDoor : getDoors()) {
            /* 11354 */
            door.getTarget().removeMapObject((MapleMapObject) destroyDoor);
            /* 11355 */
            door.getTown().removeMapObject((MapleMapObject) destroyDoor);
            /*       */
        }
        /* 11357 */
        clearDoors();
        /*       */
    }

    /*       */
    /*       */
    public void removeMechDoor() {
        /* 11361 */
        for (MechDoor destroyDoor : getMechDoors()) {
            /* 11362 */
            for (MapleCharacter chr : getMap().getCharactersThreadsafe()) {
                /* 11363 */
                destroyDoor.sendDestroyData(chr.getClient());
                /*       */
            }
            /* 11365 */
            getMap().removeMapObject((MapleMapObject) destroyDoor);
            /*       */
        }
        /* 11367 */
        clearMechDoors();
        /*       */
    }

    /*       */
    /*       */
    public void changeRemoval() {
        /* 11371 */
        changeRemoval(false);
        /*       */
    }

    /*       */
    /*       */
    public void changeRemoval(boolean dc) {
        /* 11375 */
        if (getCheatTracker() != null && dc) {
            /* 11376 */
            getCheatTracker().dispose();
            /*       */
        }
        /* 11378 */
        dispelSummons();
        /* 11379 */
        if (!dc) {
            /* 11380 */
            cancelEffectFromBuffStat(MapleBuffStat.飞翔);
            /* 11381 */
            cancelEffectFromBuffStat(MapleBuffStat.骑兽技能);
            /* 11382 */
            cancelEffectFromBuffStat(MapleBuffStat.金属机甲);
            /* 11383 */
            cancelEffectFromBuffStat(MapleBuffStat.恢复效果);
            /* 11384 */
            cancelEffectFromBuffStat(MapleBuffStat.精神连接);
            /* 11385 */
            cancelEffectFromBuffStat(MapleBuffStat.飞行骑乘);
            /*       */
        }
        /* 11387 */
        if (getPyramidSubway() != null) {
            /* 11388 */
            getPyramidSubway().dispose(this);
            /*       */
        }
        /* 11390 */
        if (this.playerShop != null && !dc) {
            /* 11391 */
            this.playerShop.removeVisitor(this);
            /* 11392 */
            if (this.playerShop.isOwner(this)) {
                /* 11393 */
                this.playerShop.setOpen(true);
                /*       */
            }
            /*       */
        }
        /* 11396 */
        if (!getDoors().isEmpty()) {
            /* 11397 */
            removeDoor();
            /*       */
        }
        /* 11399 */
        if (!getMechDoors().isEmpty()) {
            /* 11400 */
            removeMechDoor();
            /*       */
        }
        /* 11402 */
        NPCScriptManager.getInstance().dispose(this.client);
        /* 11403 */
        cancelFairySchedule(false);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    public void updateTick(int newTick) {
        /* 11409 */
        this.anticheat.updateTick(newTick);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public long getCurrenttime() {
        /* 11414 */
        return this.currenttime;
        /*       */
    }

    /*       */
    /*       */
    public void setCurrenttime(long currenttime) {
        /* 11418 */
        this.currenttime = currenttime;
        /*       */
    }

    /*       */
    /*       */
    public long getDeadtime() {
        /* 11422 */
        return this.deadtime;
        /*       */
    }

    /*       */
    /*       */
    public void setDeadtime(long deadtime) {
        /* 11426 */
        this.deadtime = deadtime;
        /*       */
    }

    /*       */
    /*       */
    public long getLasttime() {
        /* 11430 */
        return this.lasttime;
        /*       */
    }

    /*       */
    /*       */
    public void setLasttime(long lasttime) {
        /* 11434 */
        this.lasttime = lasttime;
        /*       */
    }

    /*       */
    /*       */
    public boolean canUseFamilyBuff(MapleFamilyBuff buff) {
        /* 11438 */
        MapleQuestStatus stat = getQuestNoAdd(MapleQuest.getInstance(buff.questID));
        /* 11439 */
        if (stat == null) {
            /* 11440 */
            return true;
            /*       */
        }
        /* 11442 */
        if (stat.getCustomData() == null) {
            /* 11443 */
            stat.setCustomData("0");
            /*       */
        }
        /* 11445 */
        return (Long.parseLong(stat.getCustomData()) + 86400000L < System.currentTimeMillis());
        /*       */
    }

    /*       */
    /*       */
    public void useFamilyBuff(MapleFamilyBuff buff) {
        /* 11449 */
        MapleQuestStatus stat = getQuestNAdd(MapleQuest.getInstance(buff.questID));
        /* 11450 */
        stat.setCustomData(String.valueOf(System.currentTimeMillis()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public List<Integer> usedBuffs() {
        /* 11455 */
        List<Integer> used = new ArrayList<>();
        /* 11456 */
        MapleFamilyBuff[] z = MapleFamilyBuff.values();
        /* 11457 */
        for (int i = 0; i < z.length; i++) {
            /* 11458 */
            if (!canUseFamilyBuff(z[i])) {
                /* 11459 */
                used.add(Integer.valueOf(i));
                /*       */
            }
            /*       */
        }
        /* 11462 */
        return used;
        /*       */
    }

    /*       */
    /*       */
    public String getTeleportName() {
        /* 11466 */
        return this.teleportname;
        /*       */
    }

    /*       */
    /*       */
    public void setTeleportName(String tname) {
        /* 11470 */
        this.teleportname = tname;
        /*       */
    }

    /*       */
    /*       */
    public int getNoJuniors() {
        /* 11474 */
        if (this.mfc == null) {
            /* 11475 */
            return 0;
            /*       */
        }
        /* 11477 */
        return this.mfc.getNoJuniors();
        /*       */
    }

    /*       */
    /*       */
    public MapleFamilyCharacter getMFC() {
        /* 11481 */
        return this.mfc;
        /*       */
    }

    /*       */
    /*       */
    public void makeMFC(int familyid, int seniorid, int junior1, int junior2) {
        /* 11485 */
        if (familyid > 0) {
            /* 11486 */
            MapleFamily f = WorldFamilyService.getInstance().getFamily(familyid);
            /* 11487 */
            if (f == null) {
                /* 11488 */
                this.mfc = null;
                /*       */
            } else {
                /* 11490 */
                this.mfc = f.getMFC(this.id);
                /* 11491 */
                if (this.mfc == null) {
                    /* 11492 */
                    this.mfc = f.addFamilyMemberInfo(this, seniorid, junior1, junior2);
                    /*       */
                }
                /* 11494 */
                if (this.mfc.getSeniorId() != seniorid) {
                    /* 11495 */
                    this.mfc.setSeniorId(seniorid);
                    /*       */
                }
                /* 11497 */
                if (this.mfc.getJunior1() != junior1) {
                    /* 11498 */
                    this.mfc.setJunior1(junior1);
                    /*       */
                }
                /* 11500 */
                if (this.mfc.getJunior2() != junior2) {
                    /* 11501 */
                    this.mfc.setJunior2(junior2);
                    /*       */
                }
                /*       */
            }
            /*       */
        } else {
            /* 11505 */
            this.mfc = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void setFamily(int newf, int news, int newj1, int newj2) {
        /* 11510 */
        if (this.mfc == null || newf != this.mfc.getFamilyId() || news != this.mfc.getSeniorId() || newj1 != this.mfc.getJunior1() || newj2 != this.mfc.getJunior2()) {
            /* 11511 */
            makeMFC(newf, news, newj1, newj2);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getGachExp() {
        /* 11516 */
        return this.gachexp;
        /*       */
    }

    /*       */
    /*       */
    public void setGachExp(int ge) {
        /* 11520 */
        this.gachexp = ge;
        /*       */
    }

    /*       */
    /*       */
    public boolean isInBlockedMap() {
        /* 11524 */
        if (!isAlive() || getPyramidSubway() != null || getMap().getSquadByMap() != null || getEventInstance() != null || getMap().getEMByMap() != null) {
            /* 11525 */
            return true;
            /*       */
        }
        /* 11527 */
        if ((getMapId() >= 680000210 && getMapId() <= 680000502) || (getMapId() / 10000 == 92502 && getMapId() >= 925020100) || getMapId() / 10000 == 92503 || getMapId() == 180000001) {
            /* 11528 */
            return true;
            /*       */
        }
        /* 11530 */
        return ServerConstants.isBlockedMapFM(getMapId());
        /*       */
    }

    /*       */
    /*       */
    public boolean isInTownMap() {
        /* 11534 */
        if (hasBlockedInventory() || !getMap().isTown() || FieldLimitType.VipRock.check(getMap().getFieldLimit()) || getEventInstance() != null) {
            /* 11535 */
            return false;
            /*       */
        }
        /* 11537 */
        return !ServerConstants.isBlockedMapFM(getMapId());
        /*       */
    }

    /*       */
    /*       */
    public boolean hasBlockedInventory() {
        /* 11541 */
        return (!isAlive() || getTrade() != null || getConversation() > 0 || getDirection() >= 0 || getPlayerShop() != null || getBattle() != null || this.map == null);
        /*       */
    }

    /*       */
    /*       */
    public void startPartySearch(List<Integer> jobs, int maxLevel, int minLevel, int membersNeeded) {
        /* 11545 */
        for (MapleCharacter chr : this.map.getCharacters()) {
            /* 11546 */
            if (chr.getId() != this.id && chr.getParty() == null && chr.getLevel() >= minLevel && chr.getLevel() <= maxLevel && (jobs.isEmpty() || jobs.contains(Integer.valueOf(chr.getJob()))) && (isGM() || !chr.isGM())) {
                /* 11547 */
                if (this.party != null && this.party.getMembers().size() < 6 && this.party.getMembers().size() < membersNeeded) {
                    /* 11548 */
                    chr.setParty(this.party);
                    /* 11549 */
                    WorldPartyService.getInstance().updateParty(this.party.getPartyId(), PartyOperation.加入队伍, new MaplePartyCharacter(chr));
                    /* 11550 */
                    chr.receivePartyMemberHP();
                    /* 11551 */
                    chr.updatePartyMemberHP();
                    /*       */
                    continue;
                    /*       */
                }
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public Battler getBattler(int pos) {
        /* 11560 */
        return this.battlers[pos];
        /*       */
    }

    /*       */
    /*       */
    public Battler[] getBattlers() {
        /* 11564 */
        return this.battlers;
        /*       */
    }

    /*       */
    /*       */
    public List<Battler> getBoxed() {
        /* 11568 */
        return this.boxed;
        /*       */
    }

    /*       */
    /*       */
    public PokemonBattle getBattle() {
        /* 11572 */
        return this.battle;
        /*       */
    }

    /*       */
    /*       */
    public void setBattle(PokemonBattle b) {
        /* 11576 */
        this.battle = b;
        /*       */
    }

    /*       */
    /*       */
    public int countBattlers() {
        /* 11580 */
        int ret = 0;
        /* 11581 */
        for (Battler battler : this.battlers) {
            /* 11582 */
            if (battler != null) {
                /* 11583 */
                ret++;
                /*       */
            }
            /*       */
        }
        /* 11586 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void changedBattler() {
        /* 11590 */
        this.changed_pokemon = true;
        /*       */
    }

    /*       */
    /*       */
    public void makeBattler(int index, int monsterId) {
        /* 11594 */
        MapleMonsterStats mons = MapleLifeFactory.getMonsterStats(monsterId);
        /* 11595 */
        this.battlers[index] = new Battler(mons);
        /* 11596 */
        this.battlers[index].setCharacterId(this.id);
        /* 11597 */
        this.changed_pokemon = true;
        /* 11598 */
        getMonsterBook().monsterCaught(this.client, monsterId, mons.getName());
        /*       */
    }

    /*       */
    /*       */
    public boolean removeBattler(int ind) {
        /* 11602 */
        if (countBattlers() <= 1) {
            /* 11603 */
            return false;
            /*       */
        }
        /* 11605 */
        if (ind == this.battlers.length) {
            /* 11606 */
            this.battlers[ind] = null;
            /*       */
        } else {
            /* 11608 */
            for (int i = ind; i < this.battlers.length; i++) {
                /* 11609 */
                this.battlers[i] = (i + 1 == this.battlers.length) ? null : this.battlers[i + 1];
                /*       */
            }
            /*       */
        }
        /* 11612 */
        this.changed_pokemon = true;
        /* 11613 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    public int getChallenge() {
        /* 11617 */
        return this.challenge;
        /*       */
    }

    /*       */
    /*       */
    public void setChallenge(int c) {
        /* 11621 */
        this.challenge = c;
        /*       */
    }

    /*       */
    /*       */
    public short getFatigue() {
        /* 11625 */
        return this.fatigue;
        /*       */
    }

    /*       */
    /*       */
    public void setFatigue(int j) {
        /* 11629 */
        this.fatigue = (short) Math.max(0, j);
        /* 11630 */
        updateSingleStat(MapleStat.疲劳, this.fatigue);
        /*       */
    }

    /*       */
    /*       */
    public void fakeRelog() {
        /* 11634 */
        MapleMap mapp = getMap();
        /* 11635 */
        mapp.setCheckStates(false);
        /* 11636 */
        mapp.removePlayer(this);
        /* 11637 */
        mapp.addPlayer(this);
        /* 11638 */
        mapp.setCheckStates(true);
        /* 11639 */
        this.client.announce(MaplePacketCreator.getWarpToMap(this, this.map, 0));
        /* 11640 */
        this.client.announce(MaplePacketCreator.serverNotice(5, "刷新人数据完成..."));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean canSummon() {
        /* 11647 */
        return canSummon(5000);
        /*       */
    }

    /*       */
    /*       */
    public boolean canSummon(int checkTime) {
        /* 11651 */
        if (this.lastSummonTime <= 0L) {
            /* 11652 */
            prepareSummonTime();
            /*       */
        }
        /* 11654 */
        return (this.lastSummonTime + checkTime < System.currentTimeMillis());
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    private void prepareSummonTime() {
        /* 11661 */
        this.lastSummonTime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    public int getIntNoRecord(int questID) {
        /* 11665 */
        MapleQuestStatus stat = getQuestNoAdd(MapleQuest.getInstance(questID));
        /* 11666 */
        if (stat == null || stat.getCustomData() == null) {
            /* 11667 */
            return 0;
            /*       */
        }
        /* 11669 */
        return Integer.parseInt(stat.getCustomData());
        /*       */
    }

    /*       */
    /*       */
    public int getIntRecord(int questID) {
        /* 11673 */
        MapleQuestStatus stat = getQuestNAdd(MapleQuest.getInstance(questID));
        /* 11674 */
        if (stat.getCustomData() == null) {
            /* 11675 */
            stat.setCustomData("0");
            /*       */
        }
        /* 11677 */
        return Integer.parseInt(stat.getCustomData());
        /*       */
    }

    /*       */
    /*       */
    public long getLongRecord(int questID) {
        /* 11681 */
        MapleQuestStatus stat = getQuestNAdd(MapleQuest.getInstance(questID));
        /* 11682 */
        if (stat.getCustomData() == null) {
            /* 11683 */
            stat.setCustomData("0");
            /*       */
        }
        /* 11685 */
        return Long.parseLong(stat.getCustomData());
        /*       */
    }

    /*       */
    /*       */
    public void setLongRecord(int questID, long record) {
        /* 11689 */
        MapleQuestStatus stat = getQuestNAdd(MapleQuest.getInstance(questID));
        /* 11690 */
        if (stat.getCustomData() == null) {
            /* 11691 */
            stat.setCustomData("0");
            /*       */
        }
        /* 11693 */
        stat.setCustomData(String.valueOf(record));
        /*       */
    }

    /*       */
    /*       */
    public void updatePetAuto() {
        /* 11697 */
        this.client.announce(MaplePacketCreator.petAutoHP(getIntRecord(122221)));
        /* 11698 */
        this.client.announce(MaplePacketCreator.petAutoMP(getIntRecord(122223)));
        /* 11699 */
        this.client.announce(MaplePacketCreator.petAutoBuff(getIntRecord(122224)));
        /*       */
    }

    /*       */
    /*       */
    public long getChangeTime() {
        /* 11703 */
        return this.mapChangeTime;
        /*       */
    }

    /*       */
    /*       */
    public void setChangeTime(boolean changeMap) {
        /* 11707 */
        this.mapChangeTime = System.currentTimeMillis();
        /* 11708 */
        if (changeMap) {
            /* 11709 */
            getCheatTracker().resetInMapIimeCount();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public Map<ReportType, Integer> getReports() {
        /* 11714 */
        return this.reports;
        /*       */
    }

    /*       */
    /*       */
    public void addReport(ReportType type) {
        /* 11718 */
        Integer value = this.reports.get(type);
        /* 11719 */
        this.reports.put(type, Integer.valueOf((value == null) ? 1 : (value.intValue() + 1)));
        /* 11720 */
        this.changed_reports = true;
        /*       */
    }

    /*       */
    /*       */
    public void clearReports(ReportType type) {
        /* 11724 */
        this.reports.remove(type);
        /* 11725 */
        this.changed_reports = true;
        /*       */
    }

    /*       */
    /*       */
    public void clearReports() {
        /* 11729 */
        this.reports.clear();
        /* 11730 */
        this.changed_reports = true;
        /*       */
    }

    /*       */
    /*       */
    public int getReportPoints() {
        /* 11734 */
        int ret = 0;
        /* 11735 */
        for (Integer entry : this.reports.values()) {
            /* 11736 */
            ret += entry.intValue();
            /*       */
        }
        /* 11738 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public String getReportSummary() {
        /* 11742 */
        StringBuilder ret = new StringBuilder();
        /* 11743 */
        List<Pair<ReportType, Integer>> offenseList = new ArrayList<>();
        /* 11744 */
        for (Map.Entry<ReportType, Integer> entry : this.reports.entrySet()) {
            /* 11745 */
            offenseList.add(new Pair(entry.getKey(), entry.getValue()));
            /*       */
        }
        /* 11747 */
        offenseList.sort((o1, o2) -> {
            /*       */
            int thisVal = ((Integer) o1.getRight()).intValue();
            /*       */
            int anotherVal = ((Integer) o2.getRight()).intValue();
            /*       */
            return (thisVal < anotherVal) ? 1 : ((thisVal == anotherVal) ? 0 : -1);
            /*       */
        });
        /* 11752 */
        for (Pair<ReportType, Integer> anOffenseList : offenseList) {
            /* 11753 */
            ret.append(StringUtil.makeEnumHumanReadable(((ReportType) anOffenseList.left).name()));
            /* 11754 */
            ret.append(": ");
            /* 11755 */
            ret.append(anOffenseList.right);
            /* 11756 */
            ret.append(" ");
            /*       */
        }
        /* 11758 */
        return ret.toString();
        /*       */
    }

    /*       */
    /*       */
    public short getScrolledPosition() {
        /* 11762 */
        return this.scrolledPosition;
        /*       */
    }

    /*       */
    /*       */
    public void setScrolledPosition(short s) {
        /* 11766 */
        this.scrolledPosition = s;
        /*       */
    }

    /*       */
    /*       */
    public MapleTrait getTrait(MapleTraitType t) {
        /* 11770 */
        return this.traits.get(t);
        /*       */
    }

    /*       */
    /*       */
    public void forceCompleteQuest(int id) {
        /* 11774 */
        MapleQuest.getInstance(id).forceComplete(this, 9270035);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<Byte, List<Integer>> getAllExtendedSlots() {
        /* 11781 */
        return this.extendedSlots;
        /*       */
    }

    /*       */
    /*       */
    public List<Integer> getExtendedSlots(byte type) {
        /* 11785 */
        return this.extendedSlots.get(Byte.valueOf(type));
        /*       */
    }

    /*       */
    /*       */
    public int getExtendedSlot(byte type, int index) {
        /* 11789 */
        if (this.extendedSlots.isEmpty() || this.extendedSlots.get(Byte.valueOf(type)) == null || ((List) this.extendedSlots.get(Byte.valueOf(type))).size() <= index || index < 0) {
            /* 11790 */
            return -1;
            /*       */
        }
        /* 11792 */
        return ((Integer) ((List<Integer>) this.extendedSlots.get(Byte.valueOf(type))).get(index)).intValue();
        /*       */
    }

    /*       */
    /*       */
    public void changedExtended() {
        /* 11796 */
        this.changed_extendedSlots = true;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleAndroid getAndroid() {
        /* 11803 */
        return this.android;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setAndroid(MapleAndroid a) {
        /* 11810 */
        if (checkHearts()) {
            /* 11811 */
            this.android = a;
            /* 11812 */
            if (this.map != null && a != null) {
                /* 11813 */
                this.map.broadcastMessage(AndroidPacket.spawnAndroid(this, a));
                /* 11814 */
                this.map.broadcastMessage(AndroidPacket.showAndroidEmotion(getId(), Randomizer.nextInt(17) + 1));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void removeAndroid() {
        /* 11823 */
        if (this.map != null) {
            /* 11824 */
            this.map.broadcastMessage(AndroidPacket.deactivateAndroid(this.id));
            /*       */
        }
        /* 11826 */
        if (this.android != null) {
            /* 11827 */
            this.android.saveToDb();
            /*       */
        }
        /* 11829 */
        this.android = null;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateAndroid(int size, int itemId) {
        /* 11836 */
        if (this.map != null) {
            /* 11837 */
            this.map.broadcastMessage(AndroidPacket.updateAndroidLook(getId(), size, itemId));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean checkHearts() {
        /* 11845 */
        return (getInventory(MapleInventoryType.EQUIPPED).getItem((short) -35) != null);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public List<MapleShopItem> getRebuy() {
        /* 11852 */
        return this.rebuy;
        /*       */
    }

    /*       */
    /*       */
    public MapleShopItem findRebuyItemById(int itemId, int pos) {
        /* 11856 */
        MapleShopItem posItem = getRebuy().get(pos);
        /*       */
        /* 11858 */
        if (posItem.getItemId() == itemId) {
            /* 11859 */
            return posItem;
            /*       */
        }
        /* 11861 */
        return null;
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, MonsterFamiliar> getFamiliars() {
        /* 11865 */
        return this.familiars;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addFamiliarsInfo(MonsterFamiliar mf) {
        /* 11873 */
        this.changed_familiars = true;
        /* 11874 */
        this.familiars.put(Integer.valueOf(mf.getId()), mf);
        /*       */
    }

    /*       */
    /*       */
    public void removeFamiliarsInfo(int id) {
        /* 11878 */
        if (this.familiars.containsKey(Integer.valueOf(id))) {
            /* 11879 */
            this.changed_familiars = true;
            /* 11880 */
            this.familiars.remove(Integer.valueOf(id));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public MonsterFamiliarObj getSummonedFamiliar() {
        /* 11885 */
        return this.summonedFamiliar;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void removeFamiliar() {
        /* 11893 */
        if (this.summonedFamiliar != null && this.map != null) {
            /* 11894 */
            this.summonedFamiliar.getFamiliar().setSummon(false);
            /* 11895 */
            removeVisibleFamiliar();
            /*       */
        }
        /* 11897 */
        this.summonedFamiliar = null;
        /*       */
    }

    /*       */
    /*       */
    public void removeVisibleFamiliar() {
        /* 11901 */
        getMap().removeMapObject((MapleMapObject) this.summonedFamiliar);
        /* 11902 */
        removeVisibleMapObject((MapleMapObject) this.summonedFamiliar);
        /*       */
        /*       */
        /*       */
        /*       */
        /*       */
        /* 11908 */
        getMap().broadcastMessage(FamiliarPacket.RemoveFamiliar(this.summonedFamiliar.getFamiliar()));
        /* 11909 */
        this.client.announce(FamiliarPacket.UpdateFamiliarSpawnUI(this.summonedFamiliar.getFamiliar(), false));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void spawnFamiliar(MonsterFamiliar mf) {
        /* 11914 */
        this.summonedFamiliar = new MonsterFamiliarObj(mf);
        /* 11915 */
        mf.setSummon(true);
        /* 11916 */
        this.summonedFamiliar.setStance(0);
        /* 11917 */
        this.summonedFamiliar.setPosition(getPosition());
        /* 11918 */
        mf.setFh(getFH());
        /* 11919 */
        addVisibleMapObject((MapleMapObject) this.summonedFamiliar);
        /* 11920 */
        if (this.map != null) {
            /* 11921 */
            getMap().spawnFamiliar(this.summonedFamiliar);
            /* 11922 */
            this.client.announce(FamiliarPacket.UpdateFamiliarSpawnUI(this.summonedFamiliar.getFamiliar(), true));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public final int getAIFamiliarID() {
        /* 11927 */
        return this.AIFamiliarID.getAndIncrement();
        /*       */
    }

    /*       */
    /*       */
    public final int getCurrAIFamiliarID() {
        /* 11931 */
        return this.AIFamiliarID.get();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleImp[] getImps() {
        /* 11938 */
        return this.imps;
        /*       */
    }

    /*       */
    /*       */
    public void sendImp() {
        /* 11942 */
        for (int i = 0; i < this.imps.length; i++) {
            /* 11943 */
            if (this.imps[i] != null) {
                /* 11944 */
                this.client.announce(MaplePacketCreator.updateImp(this.imps[i], ImpFlag.SUMMONED.getValue(), i, true));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getBattlePoints() {
        /* 11950 */
        return this.pvpPoints;
        /*       */
    }

    /*       */
    /*       */
    public void setBattlePoints(int p) {
        /* 11954 */
        if (p != this.pvpPoints) {
            /* 11955 */
            this.client.announce(UIPacket.getBPMsg(p - this.pvpPoints));
            /* 11956 */
            updateSingleStat(MapleStat.BATTLE_POINTS, p);
            /*       */
        }
        /* 11958 */
        this.pvpPoints = p;
        /*       */
    }

    /*       */
    /*       */
    public int getTotalBattleExp() {
        /* 11962 */
        return this.pvpExp;
        /*       */
    }

    /*       */
    /*       */
    public void setTotalBattleExp(int p) {
        /* 11966 */
        int previous = this.pvpExp;
        /* 11967 */
        this.pvpExp = p;
        /* 11968 */
        if (p != previous) {
            /* 11969 */
            this.stats.recalcPVPRank(this);
            /* 11970 */
            updateSingleStat(MapleStat.BATTLE_EXP, this.stats.pvpExp);
            /* 11971 */
            updateSingleStat(MapleStat.BATTLE_RANK, this.stats.pvpRank);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void changeTeam(int newTeam) {
        /* 11976 */
        this.coconutteam = newTeam;
        /* 11977 */
        if (!inPVP())
            /*       */ {
            /*       */
            /*       */
            /* 11981 */
            this.client.announce(MaplePacketCreator.showEquipEffect(newTeam));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void disease(int type, int level) {
        /* 11997 */
        if (MapleDisease.getBySkill(type) == null) {
            /*       */
            return;
            /*       */
        }
        /* 12000 */
        this.chair = 0;
        /* 12001 */
        this.chairMsg = "";
        /* 12002 */
        this.chairType = 0;
        /* 12003 */
        this.client.announce(MaplePacketCreator.cancelChair(-1, 0));
        /* 12004 */
        this.map.broadcastMessage(this, MaplePacketCreator.showChair(this, true), false);
        /* 12005 */
        giveDebuff(MapleDisease.getBySkill(type), MobSkillFactory.getMobSkill(type, level));
        /*       */
    }

    /*       */
    /*       */
    public boolean inPVP() {
        /* 12009 */
        return (this.eventInstance != null && this.eventInstance.getName().startsWith("PVP") && ServerConfig.CHANNEL_OPENPVP);
        /*       */
    }

    /*       */
    /*       */
    public long getCooldownLimit(int skillid) {
        /* 12013 */
        for (MapleCoolDownValueHolder mcdvh : getAllCooldowns()) {
            /* 12014 */
            if (mcdvh.skillId == skillid) {
                /* 12015 */
                return System.currentTimeMillis() - mcdvh.startTime;
                /*       */
            }
            /*       */
        }
        /* 12018 */
        return 0L;
        /*       */
    }

    /*       */
    /*       */
    public List<MapleCoolDownValueHolder> getAllCooldowns() {
        /* 12022 */
        List<MapleCoolDownValueHolder> ret = new ArrayList<>();
        /* 12023 */
        for (MapleCoolDownValueHolder mcdvh : this.coolDowns.values()) {
            /* 12024 */
            ret.add(new MapleCoolDownValueHolder(mcdvh.skillId, mcdvh.startTime, mcdvh.length));
            /*       */
        }
        /* 12026 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public void clearAllCooldowns() {
        /* 12030 */
        for (MapleCoolDownValueHolder m : getCooldowns()) {
            /* 12031 */
            int skil = m.skillId;
            /* 12032 */
            removeCooldown(skil);
            /* 12033 */
            this.client.announce(MaplePacketCreator.skillCooldown(skil, 0));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Pair<Double, Boolean> modifyDamageTaken(double damage, MapleMapObject attacke) {
        /* 12041 */
        Pair<Double, Boolean> ret = new Pair(Double.valueOf(damage), Boolean.valueOf(false));
        /* 12042 */
        if (damage < 0.0D) {
            /* 12043 */
            return ret;
            /*       */
        }
        /* 12045 */
        if (this.stats.ignoreDAMr > 0 && Randomizer.nextInt(100) < this.stats.ignoreDAMr_rate) {
            /* 12046 */
            damage -= Math.floor(this.stats.ignoreDAMr * damage / 100.0D);
            /*       */
        }
        /* 12048 */
        if (this.stats.ignoreDAM > 0 && Randomizer.nextInt(100) < this.stats.ignoreDAM_rate) {
            /* 12049 */
            damage -= this.stats.ignoreDAM;
            /*       */
        }
        /* 12051 */
        Integer div = getBuffedValue(MapleBuffStat.祝福护甲);
        /* 12052 */
        Integer div2 = getBuffedValue(MapleBuffStat.神圣魔法盾);
        /* 12053 */
        if (div2 != null) {
            /* 12054 */
            if (div2.intValue() <= 0) {
                /* 12055 */
                cancelEffectFromBuffStat(MapleBuffStat.神圣魔法盾);
                /*       */
            } else {
                /* 12057 */
                setBuffedValue(MapleBuffStat.神圣魔法盾, div2.intValue() - 1);
                /* 12058 */
                damage = 0.0D;
                /*       */
            }
            /* 12060 */
        } else if (div != null) {
            /* 12061 */
            if (div.intValue() <= 0) {
                /* 12062 */
                cancelEffectFromBuffStat(MapleBuffStat.祝福护甲);
                /*       */
            } else {
                /* 12064 */
                setBuffedValue(MapleBuffStat.祝福护甲, div.intValue() - 1);
                /* 12065 */
                damage = 0.0D;
                /*       */
            }
            /*       */
        }
        /*       */
        /* 12069 */
        if (getBuffedValue(MapleBuffStat.寒冰灵气) != null) {
            /* 12070 */
            damage -= damage * 0.2D;
            /*       */
        }
        /* 12072 */
        List<Integer> attack = (attacke instanceof MapleMonster || attacke == null) ? null : new ArrayList<>();
        /* 12073 */
        if (damage > 0.0D) {
            /* 12074 */
            if (getJob() == 122 && !skillisCooling(1210016)) {
                /* 12075 */
                Skill divine = SkillFactory.getSkill(1210016);
                /* 12076 */
                if (getTotalSkillLevel(divine) > 0) {
                    /* 12077 */
                    MapleStatEffect divineShield = divine.getEffect(getTotalSkillLevel(divine));
                    /* 12078 */
                    if (divineShield.makeChanceResult()) {
                        /* 12079 */
                        divineShield.applyTo(this);
                        /* 12080 */
                        this.client.announce(MaplePacketCreator.skillCooldown(1210016, divineShield.getCooldown(this)));
                        /* 12081 */
                        addCooldown(1210016, System.currentTimeMillis(), (divineShield.getCooldown(this) * 1000));
                        /*       */
                    }
                    /*       */
                }
                /* 12084 */
            } else if (getJob() == 2005 || getJob() == 2500 || getJob() == 2510 || getJob() == 2511 || getJob() == 2512) {
                /* 12085 */
                Skill skill = SkillFactory.getSkill(20050285);
                /* 12086 */
                if (getTotalSkillLevel(skill) > 0) {
                    /* 12087 */
                    MapleStatEffect effect = skill.getEffect(getTotalSkillLevel(skill));
                    /*       */
                    /* 12089 */
                    damage -= damage * effect.getDamAbsorbShieldR() / 100.0D;
                    /*       */
                }
                /*       */
                /* 12092 */
            } else if (getJob() == 2112) {
                /* 12093 */
                Skill achilles = SkillFactory.getSkill(21120004);
                /* 12094 */
                if (getTotalSkillLevel(achilles) > 0) {
                    /* 12095 */
                    MapleStatEffect multiplier = achilles.getEffect(getTotalSkillLevel(achilles));
                    /* 12096 */
                    damage = multiplier.getX() / 1000.0D * damage;
                    /*       */
                }
                /* 12098 */
            } else if (getJob() == 111 || getJob() == 112) {
                /* 12099 */
                handleOrbgain(true);
                /* 12100 */
            } else if (getJob() == 321 || getJob() == 322) {
                /* 12101 */
                MapleStatEffect effect = getStatForBuff(MapleBuffStat.伤害置换);
                /* 12102 */
                if (effect != null && getBuffedValue(MapleBuffStat.伤害置换) != null) {
                    /* 12103 */
                    int buffHp = getBuffedValue(MapleBuffStat.伤害置换).intValue();
                    /* 12104 */
                    if (buffHp > 0) {
                        /* 12105 */
                        int xishou = (int) (damage * effect.makeRate(effect.getX()));
                        /* 12106 */
                        int maxxishou = (int) (this.stats.getCurrentMaxHp() * effect.makeRate(effect.getZ()));
                        /* 12107 */
                        if (xishou > maxxishou) {
                            /* 12108 */
                            xishou = maxxishou;
                            /*       */
                        }
                        /* 12110 */
                        damage -= xishou;
                        /* 12111 */
                        buffHp -= xishou;
                        /*       */
                    }
                    /* 12113 */
                    if (buffHp > 0) {
                        /* 12114 */
                        setBuffedValue(MapleBuffStat.伤害置换, buffHp);
                        /*       */
                    } else {
                        /* 12116 */
                        cancelEffectFromBuffStat(MapleBuffStat.伤害置换);
                        /*       */
                    }
                    /*       */
                }
                /* 12119 */
            } else if (getJob() == 2710 || getJob() == 2711 || getJob() == 2712) {
                /* 12120 */
                this.lastBlessOfDarknessTime = System.currentTimeMillis();
                /* 12121 */
                Skill skill = SkillFactory.getSkill(27100003);
                /* 12122 */
                if (getTotalSkillLevel(skill) > 0 && getBuffedValue(MapleBuffStat.黑暗祝福) != null) {
                    /* 12123 */
                    MapleStatEffect effect = skill.getEffect(getTotalSkillLevel(skill));
                    /* 12124 */
                    handleBlackBlessLost(1);
                    /* 12125 */
                    damage = effect.getX() / 100.0D * damage;
                    /*       */
                }
                /* 12127 */
            } else if (getJob() == 3112) {
                /* 12128 */
                Skill divine = SkillFactory.getSkill(31120009);
                /* 12129 */
                if (getTotalSkillLevel(divine) > 0) {
                    /* 12130 */
                    MapleStatEffect eff = divine.getEffect(getTotalSkillLevel(divine));
                    /* 12131 */
                    damage = eff.getX() / 1000.0D * damage;
                    /*       */
                }
                /* 12133 */
            } else if (getJob() == 5112) {
                /* 12134 */
                Skill divine = SkillFactory.getSkill(51120003);
                /* 12135 */
                if (getTotalSkillLevel(divine) > 0) {
                    /* 12136 */
                    MapleStatEffect eff = divine.getEffect(getTotalSkillLevel(divine));
                    /* 12137 */
                    damage = eff.getX() / 1000.0D * damage;
                    /*       */
                }
                /* 12139 */
            } else if (getJob() == 3611 || getJob() == 3612) {
                /* 12140 */
                MapleStatEffect effect = getStatForBuff(MapleBuffStat.影分身);
                /* 12141 */
                if (effect != null && effect.getSourceid() == 36111006) {
                    /* 12142 */
                    int 分身血量 = getBuffedValue(MapleBuffStat.影分身).intValue();
                    /* 12143 */
                    分身血量 = (int) (分身血量 - damage);
                    /* 12144 */
                    if (分身血量 > 0) {
                        /* 12145 */
                        setBuffedValue(MapleBuffStat.影分身, 分身血量);
                        /*       */
                    } else {
                        /* 12147 */
                        dispelSkill(36111006);
                        /*       */
                        /*       */
                        /*       */
                    }
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                }
                /*       */
                /*       */
                /*       */
            }
            /* 12158 */
            else if ((getJob() == 512 || getJob() == 522 || getJob() == 582 || getJob() == 592 || getJob() == 572) && getBuffedValue(MapleBuffStat.反制攻击) == null) {
                /* 12159 */
                Skill divine = SkillFactory.getSkill((getJob() == 512) ? 5120011 : 5120011);
                /* 12160 */
                int skilllevel = getTotalSkillLevel(divine);
                /* 12161 */
                if (skilllevel > 0 && !skillisCooling(divine.getId())) {
                    /* 12162 */
                    MapleStatEffect divineShield = divine.getEffect(skilllevel);
                    /* 12163 */
                    if (divineShield.makeChanceResult()) {
                        /* 12164 */
                        divineShield.applyTo(this);
                        /* 12165 */
                        this.client.announce(EffectPacket.showBuffeffect(this, divine.getId(), EffectOpcode.UserEffect_SkillAffected.getValue(), 0, skilllevel));
                        /* 12166 */
                        getMap().broadcastMessage(EffectPacket.showOwnBuffEffect(divine.getId(), EffectOpcode.UserEffect_SkillAffected.getValue(), 0, skilllevel));
                        /* 12167 */
                        this.client.announce(MaplePacketCreator.skillCooldown(divine.getId(), divineShield.getX()));
                        /* 12168 */
                        addCooldown(divine.getId(), System.currentTimeMillis(), (divineShield.getX() * 1000));
                        /*       */
                    }
                    /*       */
                }
                /* 12171 */
            } else if ((getJob() == 531 || getJob() == 532) && attacke != null) {
                /* 12172 */
                Skill divine = SkillFactory.getSkill(5310009);
                /* 12173 */
                if (getTotalSkillLevel(divine) > 0) {
                    /* 12174 */
                    MapleStatEffect divineShield = divine.getEffect(getTotalSkillLevel(divine));
                    /* 12175 */
                    if (divineShield.makeChanceResult()) {
                        /* 12176 */
                        if (attacke instanceof MapleMonster) {
                            /* 12177 */
                            MapleMonster attacker = (MapleMonster) attacke;
                            /* 12178 */
                            int theDmg = (int) ((divineShield.getDamage() * getStat().getCurrentMaxBaseDamage()) / 100.0D);
                            /* 12179 */
                            attacker.damage(this, theDmg, true);
                            /* 12180 */
                            getMap().broadcastMessage(MobPacket.damageMonster(attacker.getObjectId(), theDmg));
                            /*       */
                        } else {
                            /* 12182 */
                            MapleCharacter attacker = (MapleCharacter) attacke;
                            /* 12183 */
                            attacker.addHP(-divineShield.getDamage());
                            /* 12184 */
                            attack.add(Integer.valueOf(divineShield.getDamage()));
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /* 12188 */
            } else if (getJob() == 132 && attacke != null) {
                /* 12189 */
                Skill divine = SkillFactory.getSkill(1320011);
                /* 12190 */
                if (getTotalSkillLevel(divine) > 0 && !skillisCooling(divine.getId()) && getBuffSource(MapleBuffStat.灵魂助力) == 1301013) {
                    /* 12191 */
                    MapleStatEffect divineShield = divine.getEffect(getTotalSkillLevel(divine));
                    /* 12192 */
                    if (divineShield.makeChanceResult()) {
                        /* 12193 */
                        this.client.announce(MaplePacketCreator.skillCooldown(divine.getId(), divineShield.getCooldown(this)));
                        /* 12194 */
                        addCooldown(divine.getId(), System.currentTimeMillis(), (divineShield.getCooldown(this) * 1000));
                        /* 12195 */
                        if (attacke instanceof MapleMonster) {
                            /* 12196 */
                            MapleMonster attacker = (MapleMonster) attacke;
                            /* 12197 */
                            int theDmg = (int) ((divineShield.getDamage() * getStat().getCurrentMaxBaseDamage()) / 100.0D);
                            /* 12198 */
                            attacker.damage(this, theDmg, true);
                            /* 12199 */
                            getMap().broadcastMessage(MobPacket.damageMonster(attacker.getObjectId(), theDmg));
                            /*       */
                        } else {
                            /* 12201 */
                            MapleCharacter attacker = (MapleCharacter) attacke;
                            /* 12202 */
                            attacker.addHP(-divineShield.getDamage());
                            /* 12203 */
                            attack.add(Integer.valueOf(divineShield.getDamage()));
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /* 12208 */
            if (attacke != null) {
                /* 12209 */
                int damr = ((Randomizer.nextInt(100) < (getStat()).DAMreflect_rate) ? (getStat()).DAMreflect : 0) + ((getBuffedValue(MapleBuffStat.伤害反击) != null) ? getBuffedValue(MapleBuffStat.伤害反击).intValue() : 0);
                /* 12210 */
                if (damr > 0) {
                    /* 12211 */
                    long bouncedamage = (long) (damage * damr / 100.0D);
                    /* 12212 */
                    if (attacke instanceof MapleMonster) {
                        /* 12213 */
                        MapleMonster attacker = (MapleMonster) attacke;
                        /* 12214 */
                        bouncedamage = Math.min(bouncedamage, attacker.getMobMaxHp() / 10L);
                        /* 12215 */
                        attacker.damage(this, bouncedamage, true);
                        /* 12216 */
                        getMap().broadcastMessage(this, MobPacket.damageMonster(attacker.getObjectId(), bouncedamage), getTruePosition());
                        /* 12217 */
                        if (getBuffSource(MapleBuffStat.伤害反击) == 31101003) {
                            /* 12218 */
                            MapleStatEffect eff = getStatForBuff(MapleBuffStat.伤害反击);
                            /* 12219 */
                            attacker.applyStatus(this, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Stun, Integer.valueOf(1), eff.getSourceid(), null, false, 0), false, 5000L, true, eff);
                            /*       */
                        }
                        /*       */
                    } else {
                        /* 12222 */
                        MapleCharacter attacker = (MapleCharacter) attacke;
                        /* 12223 */
                        bouncedamage = Math.min(bouncedamage, (attacker.getStat().getCurrentMaxHp() / 10));
                        /* 12224 */
                        attacker.addHP(-((int) bouncedamage));
                        /*       */
                        /* 12226 */
                        attack.add(Integer.valueOf((int) bouncedamage));
                        /* 12227 */
                        if (getBuffSource(MapleBuffStat.伤害反击) == 31101003) {
                            /* 12228 */
                            attacker.disease(MapleDisease.昏迷.getDisease(), 1);
                            /*       */
                        }
                        /*       */
                    }
                    /* 12231 */
                    ret.right = Boolean.valueOf(true);
                    /*       */
                }
                /* 12233 */
                if ((getJob() == 411 || getJob() == 412 || getJob() == 421 || getJob() == 422 || getJob() == 1411 || getJob() == 1412) && getBuffedValue(MapleBuffStat.IndieSummoned) != null) {
                    /* 12234 */
                    List<MapleSummon> ss = getSummonsReadLock();
                    /*       */
                    try {
                        /* 12236 */
                        for (MapleSummon sum : ss) {
                            /* 12237 */
                            if (sum.getTruePosition().distanceSq(getTruePosition()) < 400000.0D && sum.is黑暗杂耍()) {
                                /* 12238 */
                                if (attacke instanceof MapleMonster) {
                                    /* 12239 */
                                    List<Pair<Long, Boolean>> allDamageNumbers = new ArrayList<>();
                                    /* 12240 */
                                    List<AttackPair> allDamage = new ArrayList<>();
                                    /* 12241 */
                                    MapleMonster attacker = (MapleMonster) attacke;
                                    /* 12242 */
                                    long theDmg = (long) (SkillFactory.getSkill(sum.getSkillId()).getEffect(sum.getSkillLevel()).getX() * damage / 100.0D);
                                    /* 12243 */
                                    allDamageNumbers.add(new Pair(Long.valueOf(theDmg), Boolean.valueOf(false)));
                                    /* 12244 */
                                    allDamage.add(new AttackPair(attacker.getObjectId(), allDamageNumbers));
                                    /* 12245 */
                                    getMap().broadcastMessage(SummonPacket.summonAttack(sum, (byte) -124, (byte) 17, allDamage, getLevel(), true));
                                    /* 12246 */
                                    attacker.damage(this, theDmg, true);
                                    /* 12247 */
                                    checkMonsterAggro(attacker);
                                    /* 12248 */
                                    if (!attacker.isAlive())
                                        /* 12249 */
                                        getClient().announce(MobPacket.killMonster(attacker.getObjectId(), 1));
                                    /*       */
                                    continue;
                                    /*       */
                                }
                                /* 12252 */
                                MapleCharacter chr = (MapleCharacter) attacke;
                                /* 12253 */
                                int dmg = SkillFactory.getSkill(sum.getSkillId()).getEffect(sum.getSkillLevel()).getX();
                                /* 12254 */
                                chr.addHP(-dmg);
                                /* 12255 */
                                attack.add(Integer.valueOf(dmg));
                                /*       */
                            }
                            /*       */
                        }
                        /*       */
                    } finally {
                        /*       */
                        /* 12260 */
                        unlockSummonsReadLock();
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /* 12264 */
        } else if (damage == 0.0D && (
                /* 12265 */       getJob() == 433 || getJob() == 434) && attacke != null) {
            /* 12266 */
            Skill divine = SkillFactory.getSkill(4330009);
            /* 12267 */
            if (getTotalSkillLevel(divine) > 0) {
                /* 12268 */
                MapleStatEffect divineShield = divine.getEffect(getTotalSkillLevel(divine));
                /* 12269 */
                int prop = getTotalSkillLevel(divine) + 10;
                /* 12270 */
                if (Randomizer.nextInt(100) < prop) {
                    /* 12271 */
                    divineShield.applyTo(this);
                    /* 12272 */
                    getCheatTracker().resetTakeDamage();
                    /* 12273 */
                    getClient().announce(MaplePacketCreator.sendCritAttack());
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
        /* 12278 */
        if ((getJob() == 3611 || getJob() == 3612) &&
                /* 12279 */       getBuffStatValueHolder(MapleBuffStat.宙斯盾系统) != null && attacke != null) {
            /* 12280 */
            handleAegisSystem(attacke.getObjectId());
            /*       */
        }
        /*       */
        /* 12283 */
        ret.left = Double.valueOf(damage);
        /* 12284 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getSoulSkillid() {
        /* 12291 */
        if (getSkillLevel(1310013) > 0) {
            /* 12292 */
            return 1310013;
            /*       */
        }
        /* 12294 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void beforeKillMonster(int moboid, int skillid) {
        /* 12302 */
        if (JobConstants.is恶魔猎手(this.job) && skillid != 80001770) {
            /* 12303 */
            handleForceGain(moboid, 30010111);
            /* 12304 */
        } else if (JobConstants.is唤灵斗师(this.job)) {
            /* 12305 */
            handleDeathPact(moboid, false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void applyIceGage(int x) {
        /* 12310 */
        updateSingleStat(MapleStat.ICE_GAGE, x);
        /*       */
    }

    /*       */
    /*       */
    public Rectangle getBounds() {
        /* 12314 */
        return new Rectangle((getTruePosition()).x - 25, (getTruePosition()).y - 75, 50, 75);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean getCygnusBless() {
        /* 12321 */
        int jobid = getJob();
        /* 12322 */
        return ((getSkillLevel(12) > 0 && jobid >= 0 && jobid < 1000) || (
                /* 12323 */       getSkillLevel(10000012) > 0 && jobid >= 1000 && jobid < 2000) || (
                /* 12324 */       getSkillLevel(20000012) > 0 && (jobid == 2000 || (jobid >= 2100 && jobid <= 2112))) || (
                /* 12325 */       getSkillLevel(20010012) > 0 && (jobid == 2001 || JobConstants.is龙神(jobid))) || (
                /* 12326 */       getSkillLevel(20020012) > 0 && (jobid == 2002 || (jobid >= 2300 && jobid <= 2312))) || (
                /* 12327 */       getSkillLevel(20030012) > 0 && (jobid == 2003 || (jobid >= 2400 && jobid <= 2412))) || (
                /* 12328 */       getSkillLevel(20040012) > 0 && (jobid == 2004 || (jobid >= 2700 && jobid <= 2712))) || (
                /* 12329 */       getSkillLevel(30000012) > 0 && (jobid == 3000 || (jobid >= 3200 && jobid <= 3512))) || (
                /* 12330 */       getSkillLevel(30010012) > 0 && JobConstants.is恶魔(jobid)) || (
                /* 12331 */       getSkillLevel(30020012) > 0 && (jobid == 3002 || (jobid >= 3600 && jobid <= 3612))) || (
                /* 12332 */       getSkillLevel(50000012) > 0 && (jobid == 5000 || (jobid >= 5100 && jobid <= 5112))) || (
                /* 12333 */       getSkillLevel(60000012) > 0 && (jobid == 6000 || (jobid >= 6100 && jobid <= 6112))) || (
                /* 12334 */       getSkillLevel(60010012) > 0 && (jobid == 6001 || (jobid >= 6500 && jobid <= 6512))) || (
                /* 12335 */       getSkillLevel(100000012) > 0 && (jobid == 10000 || (jobid >= 10100 && jobid <= 10112))) || (
                /* 12336 */       getSkillLevel(110000012) > 0 && (jobid == 11000 || (jobid >= 11200 && jobid <= 11212))));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public byte get精灵祝福() {
        /* 12341 */
        int jobid = getJob();
        /* 12342 */
        if ((getSkillLevel(20021110) > 0 && (jobid == 2002 || (jobid >= 2300 && jobid <= 2312))) || getSkillLevel(80001040) > 0) {
            /* 12343 */
            return 10;
            /*       */
        }
        /* 12345 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleForceGain(int oid, int skillid) {
        /* 12352 */
        handleForceGain(oid, skillid, 0);
        /*       */
    }

    /*       */
    /*       */
    public void handleForceGain(int moboid, int skillid, int extraForce) {
        /* 12356 */
        if (!SkillConstants.isForceIncrease(skillid) && extraForce <= 0) {
            /*       */
            return;
            /*       */
        }
        /* 12359 */
        int forceGain = Math.max(3, Randomizer.nextInt(5) + 1), forceColor = 3;
        /*       */
        /* 12361 */
        MapleMonster mob = getMap().getMonsterByOid(moboid);
        /* 12362 */
        if (mob != null && mob.getStats().isBoss()) {
            /* 12363 */
            forceGain = 10;
            /* 12364 */
            forceColor = 10;
            /*       */
        }
        /* 12366 */
        else if (skillid == 31000004 || skillid == 31001006 || skillid == 31001007 || skillid == 31001008 || skillid == 31121052 || skillid == 400011007 || skillid == 400011008 || skillid == 400011009 || skillid == 400011018) {
            /* 12367 */
            int skilllevel = getSkillLevel(31110009);
            /* 12368 */
            if (skilllevel > 0) {
                /* 12369 */
                MapleStatEffect effect = SkillFactory.getSkill(31110009).getEffect(skilllevel);
                /* 12370 */
                if (Randomizer.nextInt(100) > effect.getProp()) {
                    /*       */
                    return;
                    /*       */
                }
                /*       */
            }
            /* 12374 */
        } else if (skillid == 30010111) {
            /* 12375 */
            forceColor = 5;
            /*       */
        }
        /*       */
        /* 12378 */
        forceGain = (extraForce > 0) ? extraForce : forceGain;
        /* 12379 */
        this.specialStats.addForceCounter(forceGain);
        /* 12380 */
        getClient().announce(ForcePacket.showForce(this, moboid, this.specialStats.getForceCounter(), forceColor));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getCardStack() {
        /* 12387 */
        return this.specialStats.getCardStack();
        /*       */
    }

    /*       */
    /*       */
    public void setCardStack(int amount) {
        /* 12391 */
        this.specialStats.setCardStack(amount);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getCarteByJob() {
        /* 12398 */
        if (getSkillLevel(20031210) > 0)
            /* 12399 */ return 40;
        /* 12400 */
        if (getSkillLevel(20031209) > 0) {
            /* 12401 */
            return 20;
            /*       */
        }
        /* 12403 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public void handleCarteGain(int moid, boolean is5th) {
        /* 12407 */
        if (is5th) {
            /* 12408 */
            Skill skill = SkillFactory.getSkill(400041010);
            /* 12409 */
            MapleStatEffect effect = skill.getEffect(getSkillLevel(skill));
            /* 12410 */
            if (skill != null && getSkillLevel(400041009) > 0 && skill.getEffect(getSkillLevel(400041009)) != null) {
                /* 12411 */
                MapleForce force = new MapleForce(this.id, 400041010, 0, MapleForceType.幻影卡牌, (byte) 1, Collections.singletonList(Integer.valueOf(moid)), (byte) 2, 10, getMap(), effect.getBulletCount());
                /* 12412 */
                this.specialStats.gainCardStack();
                /* 12413 */
                send(MaplePacketCreator.updateCardStack(this.specialStats.getCardStack()));
                /* 12414 */
                send(ForcePacket.showForce(force));
                /*       */
            }
            /*       */
        } else {
            /* 12417 */
            int[] arrn2 = {24120002, 24100003};
            /* 12418 */
            for (int skillid : arrn2) {
                /* 12419 */
                Skill skill = SkillFactory.getSkill(skillid);
                /* 12420 */
                if (skill != null && getSkillLevel(skill) > 0) {
                    /* 12421 */
                    MapleStatEffect effect = skill.getEffect(getSkillLevel(skill));
                    /* 12422 */
                    if (effect.makeChanceResult() && Randomizer.nextInt(100) <= getStat().passive_sharpeye_rate()) {
                        /* 12423 */
                        MapleForce force = new MapleForce(this.id, skillid, 0, MapleForceType.幻影卡牌, (byte) 1, Collections.singletonList(Integer.valueOf(moid)), (byte) ((skillid == 24120002) ? 2 : 1), 1, getMap(), 1);
                        /* 12424 */
                        send(ForcePacket.showForce(force));
                        /* 12425 */
                        if (getCardStack() < getCarteByJob()) {
                            /* 12426 */
                            this.specialStats.gainCardStack();
                            /* 12427 */
                            send(MaplePacketCreator.updateCardStack(this.specialStats.getCardStack()));
                            /*       */
                            return;
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle黑杰克反射(MapleMonster monster, int mobid) {
        /* 12440 */
        Skill skill = SkillFactory.getSkill(400041023);
        /* 12441 */
        int skilllevel = getSkillLevel(400041022);
        /* 12442 */
        if (skilllevel > 0) {
            /* 12443 */
            MapleStatEffect effect = skill.getEffect(skilllevel);
            /* 12444 */
            if (effect != null)
                /*       */ {
                /* 12446 */
                if (this.specialStats.getStackCount() <= effect.getZ()) {
                    /* 12447 */
                    if (this.specialStats.getStackCount() == 5 || this.specialStats.getStackCount() == 10 || this.specialStats.getStackCount() == 15)
                        /*       */ {
                        /* 12449 */
                        this.client.getSession().write(MobPacket.BlackJacketResult(monster, 400041024));
                        /*       */
                    }
                    /*       */
                    /* 12452 */
                    this.specialStats.gainStackCount(1);
                    /* 12453 */
                    getMap().broadcastMessage(ForcePacket.黑杰克反射(this.id, 400041023, this.specialStats.getStackCount(), mobid, monster));
                    /*       */
                }
                /*       */
                else {
                    /*       */
                    /* 12457 */
                    this.client.getSession().write(MobPacket.BlackJacketResult(monster, 400041024));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleCardStack(int skillId) {
        /* 12468 */
        if (skillId == 0 || skillId == 36001005 || skillId == 36110004) {
            /*       */
            return;
            /*       */
        }
        /* 12471 */
        Skill skill = SkillFactory.getSkill(36001005);
        /* 12472 */
        if (getSkillLevel(skill) > 0) {
            /* 12473 */
            MapleStatEffect effect = skill.getEffect(getSkillLevel(skill));
            /*       */
            /* 12475 */
            if (System.currentTimeMillis() - this.lastForceTime < 3000L) {
                /*       */
                return;
                /*       */
            }
            /* 12478 */
            if (effect != null) {
                /* 12479 */
                List<MapleMapObject> mobs = getMap().getMonstersInRange(getPosition(), 38400.0D);
                /* 12480 */
                List<Integer> mobids = new ArrayList<>();
                /* 12481 */
                if (mobs.isEmpty()) {
                    /*       */
                    return;
                    /*       */
                }
                /* 12484 */
                for (int i = 0; i < effect.getMobCount(); i++) {
                    /* 12485 */
                    mobids.add(Integer.valueOf(((MapleMapObject) mobs.get(Randomizer.nextInt(mobs.size()))).getObjectId()));
                    /*       */
                }
                /* 12487 */
                MapleForce mapleForce = new MapleForce(this.id, 36001005, 0, MapleForceType.精准火箭, (byte) 1, mobids, (byte) 0, effect.getBulletCount(), getMap(), effect.getBulletCount());
                /* 12488 */
                this.client.announce(ForcePacket.showForce(mapleForce));
                /*       */
            }
            /* 12490 */
            this.lastForceTime = System.currentTimeMillis();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handleAegisSystem(int toMobOid) {
        /* 12495 */
        Skill skill = SkillFactory.getSkill(36111004);
        /* 12496 */
        if (getSkillLevel(skill) > 0) {
            /* 12497 */
            MapleStatEffect effect = skill.getEffect(getSkillLevel(skill));
            /* 12498 */
            if (effect != null) {
                /*       */
                /* 12500 */
                if (System.currentTimeMillis() - this.lastAegisTime < effect.getY()) {
                    /*       */
                    return;
                    /*       */
                }
                /* 12503 */
                if (effect.getProp() > Randomizer.nextInt(100)) {
                    /* 12504 */
                    MapleForce mapleForce = new MapleForce(this.id, 36110004, 0, MapleForceType.宙斯盾系统, (byte) 1, Collections.singletonList(Integer.valueOf(toMobOid)), (byte) 0, effect.getX(), getMap(), effect.getBulletCount());
                    /* 12505 */
                    this.client.announce(ForcePacket.showForce(mapleForce));
                    /*       */
                }
                /* 12507 */
                this.lastAegisTime = System.currentTimeMillis();
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void handleAssassinStack(MapleMonster mob, int visProjectile) {
        /*       */
        MapleStatEffect effect;
        /*       */
        boolean isAssassin;
        /* 12516 */
        Skill skill_2 = SkillFactory.getSkill(4101011);
        /* 12517 */
        Skill skill_4 = SkillFactory.getSkill(4120018);
        /*       */
        /*       */
        /* 12520 */
        if (getSkillLevel(skill_4) > 0) {
            /* 12521 */
            isAssassin = false;
            /* 12522 */
            effect = skill_4.getEffect(getTotalSkillLevel(skill_4));
            /* 12523 */
        } else if (getSkillLevel(skill_2) > 0) {
            /* 12524 */
            isAssassin = true;
            /* 12525 */
            effect = skill_2.getEffect(getTotalSkillLevel(skill_2));
            /*       */
        } else {
            /*       */
            return;
            /*       */
        }
        /* 12529 */
        if (effect != null && effect.makeChanceResult() && mob != null) {
            /* 12530 */
            int bulletCount = effect.getBulletCount();
            /* 12531 */
            Rectangle bounds = effect.calculateBoundingBox(mob.getTruePosition(), mob.isFacingLeft());
            /* 12532 */
            List<MapleMapObject> affected = this.map.getMapObjectsInRect(bounds, Collections.singletonList(MapleMapObjectType.MONSTER));
            /* 12533 */
            List<Integer> moboids = new ArrayList<>();
            /* 12534 */
            for (MapleMapObject mo : affected) {
                /* 12535 */
                if (mo.getObjectId() != mob.getObjectId()) {
                    /* 12536 */
                    moboids.add(Integer.valueOf(mo.getObjectId()));
                    /*       */
                }
                /*       */
            }
            /*       */
            /*       */
            /*       */
            /*       */
            /* 12543 */
            Item item = getInventory(MapleInventoryType.USE).getDartsSlot(this.level);
            /* 12544 */
            this.specialStats.gainForceCounter();
            /* 12545 */
            this.client.announce(ForcePacket.刺客标记效果(getId(), mob.getObjectId(), this.specialStats.getForceCounter(), isAssassin, moboids, bulletCount, item.getItemId(), mob.getTruePosition()));
            /* 12546 */
            this.specialStats.gainForceCounter(moboids.size());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle摩诃领域() {
        /* 12554 */
        Optional.<Skill>ofNullable(SkillFactory.getSkill(21121068)).ifPresent(skill -> {
            /*       */
            int totalSkillLevel = getTotalSkillLevel(21121068);
            /*       */
            MapleStatEffect effect = skill.getEffect(totalSkillLevel);
            /*       */
            if (totalSkillLevel > 0 && effect != null) {
                /*       */
                Rectangle bounds = effect.calculateBoundingBox(getPosition(), isFacingLeft());
                /*       */
                MapleMist mist = new MapleMist(bounds, this, effect, getPosition());
                /*       */
                getMap().spawnMist(mist, effect.getDuration(), false);
                /*       */
            }
            /*       */
        });
        /*       */
    }

    /*       */
    /*       */
    public void handle影之地刺(Point point) {
        /* 12566 */
        MapleStatEffect effect = getSkillEffect(400040008);
        /* 12567 */
        if (effect != null) {
            /* 12568 */
            int duration = getSkillEffect(400041008).getDuration();
            /* 12569 */
            Rectangle bounds = effect.calculateBoundingBox(point, isFacingLeft());
            /* 12570 */
            MapleMist mist = new MapleMist(bounds, this, effect, point);
            /* 12571 */
            getMap().spawnMist(mist, duration, false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleMesoExplosion() {
        /* 12579 */
        Skill skill = SkillFactory.getSkill(4211006);
        /* 12580 */
        int skillLevel = getTotalSkillLevel(skill);
        /* 12581 */
        if (skillLevel <= 0) {
            /*       */
            return;
            /*       */
        }
        /* 12584 */
        MapleStatEffect effect = skill.getEffect(skillLevel);
        /* 12585 */
        MapleStatEffect effect_fadong = SkillFactory.getSkill(4210014).getEffect(skillLevel);
        /* 12586 */
        if (effect != null && effect_fadong != null) {
            /*       */
            /* 12588 */
            int mobCount = effect.getMobCount();
            /* 12589 */
            Rectangle bounds = effect_fadong.calculateBoundingBox(getTruePosition(), isFacingLeft());
            /* 12590 */
            List<MapleMapObject> affected = this.map.getMapObjectsInRect(bounds, Collections.singletonList(MapleMapObjectType.MONSTER));
            /* 12591 */
            List<Integer> moboids = new ArrayList<>();
            /* 12592 */
            for (MapleMapObject mo : affected) {
                /* 12593 */
                if (moboids.size() < mobCount) {
                    /* 12594 */
                    moboids.add(Integer.valueOf(mo.getObjectId()));
                    /*       */
                }
                /*       */
            }
            /* 12597 */
            if (moboids.isEmpty()) {
                /*       */
                return;
                /*       */
            }
            /*       */
            /* 12601 */
            int mesoCount = effect.getBulletCount() + ((getTotalSkillLevel(4220045) > 0) ? 5 : 0);
            /* 12602 */
            affected = this.map.getMapObjectsInRect(bounds, Collections.singletonList(MapleMapObjectType.ITEM));
            /* 12603 */
            List<Point> posFroms = new ArrayList<>();
            /* 12604 */
            for (MapleMapObject mo : affected) {
                /* 12605 */
                if (posFroms.size() < mesoCount) {
                    /* 12606 */
                    MapleMapItem mapitem = (MapleMapItem) mo;
                    /* 12607 */
                    mapitem.getLock().lock();
                    /*       */
                    try {
                        /* 12609 */
                        if (mapitem.getMeso() > 0 && !mapitem.isPickedUp() && mapitem.getOwner() == getId()) {
                            /* 12610 */
                            Point droppos = new Point(mapitem.getTruePosition());
                            /* 12611 */
                            posFroms.add(droppos);
                            /*       */
                            /* 12613 */
                            mapitem.setPickedUp(true);
                            /* 12614 */
                            this.map.broadcastMessage(InventoryPacket.removeItemFromMap(mapitem.getObjectId(), 0, 0), mapitem.getPosition());
                            /* 12615 */
                            this.map.removeMapObject((MapleMapObject) mapitem);
                            /*       */
                        }
                        /*       */
                    } finally {
                        /* 12618 */
                        mapitem.getLock().unlock();
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
            /* 12623 */
            this.specialStats.gainForceCounter();
            /* 12624 */
            this.client.announce(ForcePacket.金钱炸弹效果(getId(), effect_fadong.getSourceid(), this.specialStats.getForceCounter(), moboids, posFroms));
            /* 12625 */
            this.specialStats.gainForceCounter(posFroms.size());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void UpdateTaoism(int Skillid) {
        /* 12633 */
        int max = 0;
        /* 12634 */
        switch (getJob()) {
            /*       */
            case 16400:
                /* 12636 */
                max = 1;
                /*       */
                break;
            /*       */
            case 16410:
                /* 12639 */
                max = 2;
                /*       */
                break;
            /*       */
            case 16411:
                /*       */
            case 16412:
                /* 12643 */
                max = 3;
                /*       */
                break;
            /*       */
        }
        /* 12646 */
        if (Skillid == 164001000 || Skillid == 164121003) {
            /* 12647 */
            setAttributeMan(1);
            /* 12648 */
        } else if (Skillid == 164101000 || Skillid == 164111003) {
            /* 12649 */
            setAttributeLand(1);
            /* 12650 */
        } else if (Skillid == 164111000 || Skillid == 164121000) {
            /* 12651 */
            setAttributeDay(1);
            /*       */
        }
        /*       */
        /* 12654 */
        if (this.specialStats.getTolAttribute() >= max) {
            /* 12655 */
            ResetRuneEffect();
            /*       */
            MapleStatEffect effect;
            /* 12657 */
            if ((effect = getSkillEffect(164110013)) != null) {
                /* 12658 */
                int hpheal = (int) (getStat().getCurrentMaxHp() * effect.getX() / 100.0D);
                /* 12659 */
                addHPMP(hpheal, hpheal);
                /*       */
            }
            /*       */
            /*       */
            MapleSummon summonBySkillID;
            /* 12663 */
            if ((summonBySkillID = getSummonBySkillID(400041050)) != null) {
                /* 12664 */
                getClient().announce(MaplePacketCreator.SummonedBeholderRevengeAttack(getId(), summonBySkillID.getObjectId(), 400041051));
                /*       */
            }
            /*       */
            /*       */
            return;
            /*       */
        }
        /* 12669 */
        getClient().announce(BuffPacket.UpdateRuneEffect(this.specialStats.getAttributeDay(), this.specialStats.getAttributeLand(), this.specialStats.getAttributeMan(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    public int getChairMode() {
        /* 12673 */
        return this.chairMode;
        /*       */
    }

    /*       */
    /*       */
    public void setChairMode(int chairMode) {
        /* 12677 */
        this.chairMode = chairMode;
        /*       */
    }

    /*       */
    /*       */
    public int[] getChairMask() {
        /* 12681 */
        return this.chairMask;
        /*       */
    }

    /*       */
    /*       */
    public void setChairMask(int[] chairMask) {
        /* 12685 */
        this.chairMask = chairMask;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getRunePoint() {
        /* 12692 */
        return this.specialStats.getRunePoint();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setRunePoint(int Rune) {
        /* 12699 */
        this.specialStats.setRunePoint(Rune);
        /* 12700 */
        getClient().announce(BuffPacket.UpdateRune(this.specialStats.getRunePoint(), this.specialStats.getScrollPoint(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainRunePoint(int Rune) {
        /* 12707 */
        this.specialStats.gainRunePoint(Rune);
        /* 12708 */
        getClient().announce(BuffPacket.UpdateRune(this.specialStats.getRunePoint(), this.specialStats.getScrollPoint(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getScrollPoint() {
        /* 12715 */
        return this.specialStats.getScrollPoint();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setScrollPoint(int Rune) {
        /* 12722 */
        this.specialStats.setScrollPoint(Rune);
        /* 12723 */
        getClient().announce(BuffPacket.UpdateRune(this.specialStats.getRunePoint(), this.specialStats.getScrollPoint(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainScrollPoint(int Rune) {
        /* 12730 */
        this.specialStats.gainScrollPoint(Rune);
        /* 12731 */
        getClient().announce(BuffPacket.UpdateRune(this.specialStats.getRunePoint(), this.specialStats.getScrollPoint(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getAttributeDay() {
        /* 12738 */
        return this.specialStats.getAttributeDay();
        /*       */
    }

    /*       */
    /*       */
    public void setAttributeDay(int a) {
        /* 12742 */
        this.specialStats.setAttributeDay(a);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getAttributeLand() {
        /* 12750 */
        return this.specialStats.getAttributeLand();
        /*       */
    }

    /*       */
    /*       */
    public void setAttributeLand(int a) {
        /* 12754 */
        this.specialStats.setAttributeLand(a);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getAttributeMan() {
        /* 12762 */
        return this.specialStats.getAttributeMan();
        /*       */
    }

    /*       */
    /*       */
    public void setAttributeMan(int a) {
        /* 12766 */
        this.specialStats.setAttributeMan(a);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void ResetRuneEffect() {
        /* 12774 */
        setAttributeMan(0);
        /* 12775 */
        setAttributeLand(0);
        /* 12776 */
        setAttributeDay(0);
        /* 12777 */
        getClient().announce(BuffPacket.UpdateRuneEffect(this.specialStats.getAttributeDay(), this.specialStats.getAttributeLand(), this.specialStats.getAttributeMan(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    public void getRuneEffect() {
        /* 12781 */
        getClient().announce(BuffPacket.UpdateRuneEffect(this.specialStats.getAttributeDay(), this.specialStats.getAttributeLand(), this.specialStats.getAttributeMan(), getJob()));
        /*       */
    }

    /*       */
    /*       */
    public void handle狂风肆虐(int skillid) {
        /* 12785 */
        Optional.<Skill>ofNullable(SkillFactory.getSkill((this.level >= 100) ? 13120003 : ((this.level >= 60) ? 13110022 : 13101022))).ifPresent(skill -> {
            /*       */
            int totalSkillLevel = getTotalSkillLevel((this.level >= 100) ? 13120003 : ((this.level >= 60) ? 13110022 : 13101022));
            /*       */
            MapleStatEffect effect = skill.getEffect(totalSkillLevel);
            /*       */
            if (totalSkillLevel > 0 && effect != null) {
                /*       */
                if (skillid == 13120010 || skillid == 13110027 || skillid == 13100027) {
                    /*       */
                    return;
                    /*       */
                }
                /*       */
                int prop = effect.getProp() + ((getSkillLevel(13120044) > 0) ? 10 : 0);
                /*       */
                if (Randomizer.nextInt(100) <= prop) {
                    /*       */
                    int mobCount = effect.getX();
                    /*       */
                    Rectangle bounds = effect.calculateBoundingBox(getTruePosition(), isFacingLeft());
                    /*       */
                    List<MapleMapObject> affected = this.map.getMapObjectsInRect(bounds, Collections.singletonList(MapleMapObjectType.MONSTER));
                    /*       */
                    List<Integer> moboids = new ArrayList<>();
                    /*       */
                    if (affected.isEmpty()) {
                        /*       */
                        return;
                        /*       */
                    }
                    /*       */
                    for (int i = 0; i < effect.getMobCount(); i++) {
                        /*       */
                        moboids.add(Integer.valueOf(((MapleMapObject) affected.get(Randomizer.nextInt(affected.size()))).getObjectId()));
                        /*       */
                    }
                    /*       */
                    MapleForce mapleForce = new MapleForce(this.id, (this.level >= 100) ? 13120010 : ((this.level >= 60) ? 13110027 : 13100027), 0, MapleForceType.狂风肆虐, (byte) 1, moboids, (byte) 1, Randomizer.rand(1, effect.getX()), getMap(), effect.getX());
                    /*       */
                    this.client.announce(ForcePacket.showForce(mapleForce));
                    /*       */
                }
                /*       */
            }
            /*       */
        });
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    public void handle暴风灭世(int oid) {
        /* 12814 */
        MapleStatEffect effect = getStatForBuff(MapleBuffStat.暴风灭世);
        /* 12815 */
        if (effect != null && effect.makeChanceResult()) {
            /* 12816 */
            this.specialStats.gainCardStack();
            /* 12817 */
            this.client.announce(ForcePacket.暴风灭世效果(getId(), oid, effect.getSourceid(), this.specialStats.getCardStack()));
            /* 12818 */
            this.specialStats.gainCardStack();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void handle火焰传动() {
        /* 12824 */
        if (this.flameMapId != getMapId() || this.flamePoint == null) {
            /* 12825 */
            this.flameMapId = getMapId();
            /* 12826 */
            this.flamePoint = new Point(getTruePosition());
            /*       */
        }
        /*       */
        /* 12829 */
        if (!this.flamePoint.equals(getTruePosition())) {
            /* 12830 */
            this.client.announce(MaplePacketCreator.instantMapWarp(getId(), this.flamePoint));
            /* 12831 */
            checkFollow();
            /* 12832 */
            getMap().movePlayer(this, this.flamePoint);
            /* 12833 */
            this.flamePoint = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int get超越数值() {
        /* 12838 */
        if (getBuffedValue(MapleBuffStat.恶魔超越) == null) {
            /* 12839 */
            return 0;
            /*       */
        }
        /* 12841 */
        return getBuffedValue(MapleBuffStat.恶魔超越).intValue();
        /*       */
    }

    /*       */
    /*       */
    public void handle超越状态(int skillId) {
        /* 12845 */
        if (!SkillConstants.is超越攻击(skillId)) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 12849 */
        int linkSkillId = SkillConstants.getLinkedAttackSkill(skillId);
        /* 12850 */
        Skill skill = SkillFactory.getSkill(linkSkillId);
        /* 12851 */
        int skilllevel = getSkillLevel(skill);
        /* 12852 */
        if (skilllevel <= 0) {
            /*       */
            return;
            /*       */
        }
        /* 12855 */
        skill.getEffect(skilllevel).applyTranscendBuff(this);
        /*       */
        /* 12857 */
        skill = SkillFactory.getSkill(30010230);
        /* 12858 */
        skilllevel = getSkillLevel(skill);
        /* 12859 */
        if (skilllevel <= 0) {
            /*       */
            return;
            /*       */
        }
        /* 12862 */
        MapleStatEffect effect = skill.getEffect(skilllevel);
        /* 12863 */
        MapleBuffStat buffStat = MapleBuffStat.恶魔超越;
        /* 12864 */
        if (getBuffedValue(buffStat) == null) {
            /* 12865 */
            effect.applyTo(this);
            /*       */
            return;
            /*       */
        }
        /* 12868 */
        int oldCombos = getBuffedIntValue(buffStat);
        /* 12869 */
        if (oldCombos < 20) {
            /* 12870 */
            int newCombos = oldCombos;
            /* 12871 */
            newCombos++;
            /* 12872 */
            if (newCombos >= 20) {
                /* 12873 */
                newCombos = 20;
                /*       */
            }
            /* 12875 */
            if (newCombos != oldCombos) {
                /* 12876 */
                setBuffedValue(buffStat, newCombos);
                /*       */
            }
            /* 12878 */
            Map<MapleBuffStat, Integer> stat = Collections.singletonMap(buffStat, Integer.valueOf(newCombos));
            /* 12879 */
            this.client.announce(BuffPacket.giveBuff(effect.getSourceid(), effect.getDuration(), stat, effect, this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle灵魂吸取(int oid) {
        /* 12887 */
        Skill skill = SkillFactory.getSkill(65111007);
        /* 12888 */
        int skilllevel = getSkillLevel(65111100);
        /* 12889 */
        if (skilllevel > 0) {
            /* 12890 */
            MapleStatEffect effect = skill.getEffect(skilllevel);
            /*       */
            /* 12892 */
            if (effect != null && Randomizer.nextInt(100) <= effect.getOnActive()) {
                /* 12893 */
                this.specialStats.gainCardStack();
                /* 12894 */
                this.client.announce(ForcePacket.灵魂吸取攻击(getId(), 65111007, this.specialStats.getCardStack(), oid));
                /* 12895 */
                this.specialStats.gainCardStack();
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle三彩箭矢(int oid) {
        /* 12904 */
        if (getBuffedValue(MapleBuffStat.三彩箭矢) == null || this.specialStats.getArrowsMode() != 2) {
            /*       */
            return;
            /*       */
        }
        /* 12907 */
        int prop = 30;
        /* 12908 */
        int skillId = 3100010;
        /* 12909 */
        Skill skill = SkillFactory.getSkill(3121016);
        /* 12910 */
        if (getSkillLevel(skill) > 0) {
            /* 12911 */
            MapleStatEffect effect = skill.getEffect(getSkillLevel(skill));
            /* 12912 */
            if (effect != null) {
                /* 12913 */
                prop = effect.getU();
                /* 12914 */
                skillId = 3120017;
                /*       */
            }
            /*       */
        }
        /* 12917 */
        if (Randomizer.nextInt(100) <= prop) {
            /* 12918 */
            this.specialStats.gainCardStack();
            /* 12919 */
            this.client.announce(ForcePacket.三彩箭矢效果(getId(), skillId, this.specialStats.getCardStack(), oid));
            /* 12920 */
            this.specialStats.gainCardStack();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle影子蝙蝠(int oid) {
        /* 12929 */
        Skill BuffSkill = SkillFactory.getSkill(14001027);
        /* 12930 */
        Skill skill_1 = SkillFactory.getSkill(14000027);
        /* 12931 */
        Skill skill_2 = SkillFactory.getSkill(14100027);
        /* 12932 */
        Skill skill_3 = SkillFactory.getSkill(14110029);
        /* 12933 */
        Skill skill_4 = SkillFactory.getSkill(14120008);
        /* 12934 */
        int skillLevel_1 = getSkillLevel(BuffSkill);
        /* 12935 */
        int skillLevel_2 = getSkillLevel(skill_2);
        /* 12936 */
        int skillLevel_3 = getSkillLevel(skill_3);
        /* 12937 */
        int skillLevel_4 = getSkillLevel(skill_4);
        /* 12938 */
        if (skillLevel_1 < 0) {
            /*       */
            return;
            /*       */
        }
        /* 12941 */
        MapleStatEffect effect = skill_1.getEffect(skillLevel_1);
        /* 12942 */
        int attackCount = effect.getZ();
        /* 12943 */
        this.attackHit++;
        /* 12944 */
        if (this.attackHit < attackCount) {
            /*       */
            return;
            /*       */
        }
        /* 12947 */
        int maxS = effect.getY();
        /* 12948 */
        if (skillLevel_2 > 0) {
            /* 12949 */
            maxS++;
            /*       */
        }
        /* 12951 */
        if (skillLevel_3 > 0) {
            /* 12952 */
            maxS++;
            /*       */
        }
        /* 12954 */
        if (skillLevel_4 > 0) {
            /* 12955 */
            maxS++;
            /*       */
        }
        /* 12957 */
        int nowSummon = (this.summons != null) ? this.summons.size() : 0;
        /* 12958 */
        if (nowSummon < maxS) {
            /* 12959 */
            effect.applyTo(this);
            /*       */
        }
        /* 12961 */
        this.attackHit = 0;
        /*       */
    }

    /*       */
    /*       */
    public int getDecorate() {
        /* 12965 */
        return this.decorate;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setDecorate(int id) {
        /* 12986 */
        if ((id >= 1012276 && id <= 1012280) || id == 1012361 || id == 1012363 || id == 1012455 || id == 1012456 || id == 1012457 || id == 1012458) {
            /* 12987 */
            this.decorate = id;
            /*       */
        } else {
            /* 12989 */
            this.decorate = 0;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean hasDecorate() {
        /* 12994 */
        return (JobConstants.is恶魔(getJob()) || JobConstants.is尖兵(getJob()) || JobConstants.is林之灵(getJob()) || JobConstants.is影魂异人(getJob()) || JobConstants.is虎影(getJob()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkTailAndEar() {
        /* 13001 */
        if (!JobConstants.is林之灵(getJob())) {
            /*       */
            return;
            /*       */
        }
        /* 13004 */
        if (!this.questinfo.containsKey(Integer.valueOf(59300))) {
            /* 13005 */
            updateInfoQuest(59300, "bTail=1;bEar=1;TailID=5010119;EarID=5010116", false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void hiddenTailAndEar(int itemId) {
        /* 13019 */
        if (!JobConstants.is林之灵(getJob()) || this.map == null) {
            /*       */
            return;
            /*       */
        }
        /* 13022 */
        int questId = 59300;
        /*       */
        /* 13024 */
        if (!this.questinfo.containsKey(Integer.valueOf(questId))) {
            /* 13025 */
            updateInfoQuest(questId, "bTail=1;bEar=1;TailID=5010119;EarID=5010116", true);
            /*       */
        }
        /*       */
        /* 13028 */
        if (!containsInfoQuest(questId, "bTail") || !containsInfoQuest(questId, "bEar") || !containsInfoQuest(questId, "TailID") || !containsInfoQuest(questId, "EarID")) {
            /* 13029 */
            updateInfoQuest(questId, "bTail=1;bEar=1;TailID=5010119;EarID=5010116", true);
            /*       */
        }
        /* 13031 */
        if (itemId == 5012000) {
            /* 13032 */
            setInfoQuestStat(questId, "bEar", containsInfoQuest(questId, "bEar=1") ? "0" : "1");
            /* 13033 */
        } else if (itemId == 5012001) {
            /* 13034 */
            setInfoQuestStat(questId, "bTail", containsInfoQuest(questId, "bTail=1") ? "0" : "1");
            /*       */
        }
        /*       */
        /* 13037 */
        this.map.broadcastMessage(MaplePacketCreator.hiddenTailAndEar(this, (itemId == 5012001), containsInfoQuest(questId, (itemId == 5012001) ? "bTail=1" : "bEar=1")));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeElfEar() {
        /* 13045 */
        updateInfoQuest(7784, containsInfoQuest(7784, "sw=") ? (containsInfoQuest(7784, "sw=1") ? "sw=0" : "sw=1") : "sw=1");
        /* 13046 */
        if (containsInfoQuest(7784, JobConstants.is双弩精灵(getJob()) ? "sw=0" : "sw=1")) {
            /* 13047 */
            getClient().announce(EffectPacket.showOwnJobChangedElf("Effect/BasicEff.img/JobChangedElf", 2, 5155000));
            /* 13048 */
            getMap().broadcastMessage(this, EffectPacket.showJobChangedElf(getId(), "Effect/BasicEff.img/JobChangedElf", 2, 5155000), false);
            /*       */
        } else {
            /* 13050 */
            getClient().announce(EffectPacket.showOwnJobChangedElf("Effect/BasicEff.img/JobChanged", 2, 5155000));
            /* 13051 */
            getMap().broadcastMessage(this, EffectPacket.showJobChangedElf(getId(), "Effect/BasicEff.img/JobChanged", 2, 5155000), false);
            /*       */
        }
        /* 13053 */
        equipChanged();
        /*       */
    }

    /*       */
    /*       */
    public boolean isElfEar() {
        /* 13057 */
        if (containsInfoQuest(7784, "sw=")) {
            /* 13058 */
            return containsInfoQuest(7784, JobConstants.is双弩精灵(getJob()) ? "sw=0" : "sw=1");
            /*       */
        }
        /* 13060 */
        return JobConstants.is双弩精灵(getJob());
        /*       */
    }

    /*       */
    /*       */
    public int getVip() {
        /* 13064 */
        return this.vip;
        /*       */
    }

    /*       */
    /*       */
    public boolean isVip() {
        /* 13068 */
        return (this.vip > 0);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setVip(int vip) {
        /* 13075 */
        if (vip >= 5) {
            /* 13076 */
            this.vip = 5;
            /* 13077 */
        } else if (vip < 0) {
            /* 13078 */
            this.vip = 0;
            /*       */
        } else {
            /* 13080 */
            this.vip = vip;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public Timestamp getViptime() {
        /* 13085 */
        if (getVip() == 0) {
            /* 13086 */
            return null;
            /*       */
        }
        /* 13088 */
        return this.viptime;
        /*       */
    }

    /*       */
    /*       */
    public void setViptime(Timestamp expire) {
        /* 13092 */
        this.viptime = expire;
        /*       */
    }

    /*       */
    /*       */
    public void setViptime(long period) {
        /* 13096 */
        if (period > 0L) {
            /* 13097 */
            Timestamp expiration = new Timestamp(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
            /* 13098 */
            setViptime(expiration);
            /*       */
        } else {
            /* 13100 */
            setViptime((Timestamp) null);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getBossLog(String boss) {
        /* 13108 */
        return getBossLog(boss, 0);
        /*       */
    }

    /*       */
    /*       */
    public int getBossLog(String boss, int type) {
        /* 13112 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13113 */
            int count = 0;
            /*       */
            /* 13115 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM bosslog WHERE characterid = ? AND bossid = ?");
            /* 13116 */
            ps.setInt(1, this.id);
            /* 13117 */
            ps.setString(2, boss);
            /* 13118 */
            ResultSet rs = ps.executeQuery();
            /* 13119 */
            if (rs.next()) {
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /* 13126 */
                count = rs.getInt("count");
                /* 13127 */
                if (count < 0) {
                    /* 13128 */
                    return count;
                    /*       */
                }
                /* 13130 */
                Timestamp bossTime = rs.getTimestamp("time");
                /* 13131 */
                rs.close();
                /* 13132 */
                ps.close();
                /* 13133 */
                if (type == 0) {
                    /* 13134 */
                    Calendar sqlcal = Calendar.getInstance();
                    /* 13135 */
                    if (bossTime != null) {
                        /* 13136 */
                        sqlcal.setTimeInMillis(bossTime.getTime());
                        /*       */
                    }
                    /* 13138 */
                    if (sqlcal.get(5) + 1 <= Calendar.getInstance().get(5) || sqlcal.get(2) + 1 <= Calendar.getInstance().get(2) || sqlcal.get(1) + 1 <= Calendar.getInstance().get(1)) {
                        /* 13139 */
                        count = 0;
                        /* 13140 */
                        ps = con.prepareStatement("UPDATE bosslog SET count = 0, time = CURRENT_TIMESTAMP() WHERE characterid = ? AND bossid = ?");
                        /* 13141 */
                        ps.setInt(1, this.id);
                        /* 13142 */
                        ps.setString(2, boss);
                        /* 13143 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*       */
                }
                /*       */
            } else {
                /* 13147 */
                PreparedStatement psu = con.prepareStatement("INSERT INTO bosslog (characterid, bossid, count, type) VALUES (?, ?, ?, ?)");
                /* 13148 */
                psu.setInt(1, this.id);
                /* 13149 */
                psu.setString(2, boss);
                /* 13150 */
                psu.setInt(3, 0);
                /* 13151 */
                psu.setInt(4, type);
                /* 13152 */
                psu.executeUpdate();
                /* 13153 */
                psu.close();
                /*       */
            }
            /* 13155 */
            rs.close();
            /* 13156 */
            ps.close();
            /* 13157 */
            return count;
            /* 13158 */
        } catch (Exception Ex) {
            /* 13159 */
            log.error("获取BOSS挑战次数.", Ex);
            /* 13160 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setBossLog(String boss) {
        /* 13168 */
        setBossLog(boss, 0);
        /*       */
    }

    /*       */
    /*       */
    public void setBossLog(String boss, int type) {
        /* 13172 */
        setBossLog(boss, type, 1);
        /*       */
    }

    /*       */
    /*       */
    public void setBossLog(String boss, int type, int count) {
        /* 13176 */
        int bossCount = getBossLog(boss, type);
        /* 13177 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13178 */
            PreparedStatement ps = con.prepareStatement("UPDATE bosslog SET count = ?, type = ?, time = CURRENT_TIMESTAMP() WHERE characterid = ? AND bossid = ?");
            /* 13179 */
            ps.setInt(1, bossCount + count);
            /* 13180 */
            ps.setInt(2, type);
            /* 13181 */
            ps.setInt(3, this.id);
            /* 13182 */
            ps.setString(4, boss);
            /* 13183 */
            ps.executeUpdate();
            /* 13184 */
            ps.close();
            /* 13185 */
        } catch (Exception Ex) {
            /* 13186 */
            log.error("Error while set bosslog.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void resetBossLog(String boss) {
        /* 13194 */
        resetBossLog(boss, 0);
        /*       */
    }

    /*       */
    /*       */
    public void resetBossLog(String boss, int type) {
        /* 13198 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13199 */
            PreparedStatement ps = con.prepareStatement("UPDATE bosslog SET count = ?, type = ?, time = CURRENT_TIMESTAMP() WHERE characterid = ? AND bossid = ?");
            /* 13200 */
            ps.setInt(1, 0);
            /* 13201 */
            ps.setInt(2, type);
            /* 13202 */
            ps.setInt(3, this.id);
            /* 13203 */
            ps.setString(4, boss);
            /* 13204 */
            ps.executeUpdate();
            /* 13205 */
            ps.close();
            /* 13206 */
        } catch (Exception Ex) {
            /* 13207 */
            log.error("重置BOSS次数失败.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getBossLogAcc(String boss) {
        /* 13212 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13213 */
            int count = 0;
            /*       */
            /* 13215 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM bosslog WHERE accountid = ? AND bossid = ?");
            /* 13216 */
            ps.setInt(1, this.accountid);
            /* 13217 */
            ps.setString(2, boss);
            /* 13218 */
            ResultSet rs = ps.executeQuery();
            /* 13219 */
            if (rs.next()) {
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /* 13226 */
                count = rs.getInt("count");
                /* 13227 */
                if (count < 0) {
                    /* 13228 */
                    return count;
                    /*       */
                }
                /* 13230 */
                Timestamp bossTime = rs.getTimestamp("time");
                /* 13231 */
                rs.close();
                /* 13232 */
                ps.close();
                /* 13233 */
                Calendar sqlcal = Calendar.getInstance();
                /* 13234 */
                if (bossTime != null) {
                    /* 13235 */
                    sqlcal.setTimeInMillis(bossTime.getTime());
                    /*       */
                }
                /* 13237 */
                if (sqlcal.get(5) + 1 <= Calendar.getInstance().get(5) || sqlcal.get(2) + 1 <= Calendar.getInstance().get(2) || sqlcal.get(1) + 1 <= Calendar.getInstance().get(1)) {
                    /* 13238 */
                    count = 0;
                    /* 13239 */
                    ps = con.prepareStatement("UPDATE bosslog SET count = 0, time = CURRENT_TIMESTAMP() WHERE accountid = ? AND bossid = ?");
                    /* 13240 */
                    ps.setInt(1, this.accountid);
                    /* 13241 */
                    ps.setString(2, boss);
                    /* 13242 */
                    ps.executeUpdate();
                    /*       */
                }
                /*       */
            } else {
                /* 13245 */
                PreparedStatement psu = con.prepareStatement("INSERT INTO bosslog (accountid, characterid, bossid, count) VALUES (?, ?, ?, ?)");
                /* 13246 */
                psu.setInt(1, this.accountid);
                /* 13247 */
                psu.setInt(2, 0);
                /* 13248 */
                psu.setString(3, boss);
                /* 13249 */
                psu.setInt(4, 0);
                /* 13250 */
                psu.executeUpdate();
                /* 13251 */
                psu.close();
                /*       */
            }
            /* 13253 */
            rs.close();
            /* 13254 */
            ps.close();
            /* 13255 */
            return count;
            /* 13256 */
        } catch (Exception Ex) {
            /* 13257 */
            log.error("获取BOSS挑战次数.", Ex);
            /* 13258 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void setBossLogAcc(String bossid) {
        /* 13263 */
        setBossLogAcc(bossid, 0);
        /*       */
    }

    /*       */
    /*       */
    public void setBossLogAcc(String bossid, int bossCount) {
        /* 13267 */
        bossCount += getBossLogAcc(bossid);
        /* 13268 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13269 */
            PreparedStatement ps = con.prepareStatement("UPDATE bosslog SET count = ?, characterid = ?, time = CURRENT_TIMESTAMP() WHERE accountid = ? AND bossid = ?");
            /* 13270 */
            ps.setInt(1, bossCount + 1);
            /* 13271 */
            ps.setInt(2, this.id);
            /* 13272 */
            ps.setInt(3, this.accountid);
            /* 13273 */
            ps.setString(4, bossid);
            /* 13274 */
            ps.executeUpdate();
            /* 13275 */
            ps.close();
            /* 13276 */
        } catch (Exception Ex) {
            /* 13277 */
            log.error("Error while set bosslog.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getEventLogForDay(String event) {
        /* 13282 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13283 */
            int count = 0;
            /*       */
            /* 13285 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM eventforday WHERE eventid = ?");
            /* 13286 */
            ps.setString(1, event);
            /* 13287 */
            try (ResultSet rs = ps.executeQuery()) {
                /* 13288 */
                if (rs.next()) {
                    /* 13289 */
                    count = rs.getInt("count");
                    /* 13290 */
                    if (count < 0) {
                        /* 13291 */
                        return count;
                        /*       */
                    }
                    /* 13293 */
                    Timestamp eventTime = rs.getTimestamp("time");
                    /* 13294 */
                    rs.close();
                    /* 13295 */
                    ps.close();
                    /* 13296 */
                    Calendar sqlcal = Calendar.getInstance();
                    /* 13297 */
                    if (eventTime != null) {
                        /* 13298 */
                        sqlcal.setTimeInMillis(eventTime.getTime());
                        /*       */
                    }
                    /* 13300 */
                    if (sqlcal.get(5) + 1 <= Calendar.getInstance().get(5) || sqlcal.get(2) + 1 <= Calendar.getInstance().get(2) || sqlcal.get(1) + 1 <= Calendar.getInstance().get(1)) {
                        /* 13301 */
                        count = 0;
                        /* 13302 */
                        ps = con.prepareStatement("UPDATE eventforday SET count = 0, time = CURRENT_TIMESTAMP() WHERE eventid = ?");
                        /* 13303 */
                        ps.setString(1, event);
                        /* 13304 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*       */
                } else {
                    /* 13307 */
                    try (PreparedStatement psu = con.prepareStatement("INSERT INTO eventforday (eventid, count) VALUES (?, ?)")) {
                        /* 13308 */
                        psu.setString(1, event);
                        /* 13309 */
                        psu.setInt(2, 0);
                        /* 13310 */
                        psu.executeUpdate();
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /* 13314 */
            ps.close();
            /* 13315 */
            return count;
            /* 13316 */
        } catch (Exception Ex) {
            /* 13317 */
            log.error("Error while get EventLogForDay.", Ex);
            /* 13318 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void setEventLogForDay(String eventid) {
        /* 13323 */
        setEventLogForDay(eventid, 0);
        /*       */
    }

    /*       */
    /*       */
    public void setEventLogForDay(String eventid, int eventCount) {
        /* 13327 */
        eventCount += getEventLogForDay(eventid);
        /* 13328 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 13329 */         PreparedStatement ps = con.prepareStatement("UPDATE eventforday SET count = ?, time = CURRENT_TIMESTAMP() WHERE eventid = ?")) {
            /* 13330 */
            ps.setInt(1, eventCount + 1);
            /* 13331 */
            ps.setString(2, eventid);
            /* 13332 */
            ps.executeUpdate();
            /*       */
        }
        /* 13334 */ catch (Exception Ex) {
            /* 13335 */
            log.error("Error while set EventLogForDay.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void resetEventLogForDay(String eventid) {
        /* 13340 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 13341 */         PreparedStatement ps = con.prepareStatement("UPDATE eventforday SET count = ?, time = CURRENT_TIMESTAMP() WHERE eventid = ?")) {
            /* 13342 */
            ps.setInt(1, 0);
            /* 13343 */
            ps.setString(2, eventid);
            /* 13344 */
            ps.executeUpdate();
            /*       */
        }
        /* 13346 */ catch (Exception Ex) {
            /* 13347 */
            log.error("Error while reset EventLogForDay.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateCash() {
        /* 13355 */
        this.client.announce(MaplePacketCreator.showCharCash(this));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public short getSpace(int type) {
        /* 13362 */
        return getInventory(MapleInventoryType.getByType((byte) type)).getNumFreeSlot();
        /*       */
    }

    /*       */
    /*       */
    public boolean haveSpace(int type) {
        /* 13366 */
        short slot = getInventory(MapleInventoryType.getByType((byte) type)).getNextFreeSlot();
        /* 13367 */
        return (slot != -1);
        /*       */
    }

    /*       */
    /*       */
    public boolean haveSpaceForId(int itemid) {
        /* 13371 */
        short slot = getInventory(ItemConstants.getInventoryType(itemid)).getNextFreeSlot();
        /* 13372 */
        return (slot != -1);
        /*       */
    }

    /*       */
    /*       */
    public boolean canHold() {
        /* 13376 */
        for (int i = 1; i <= 5; i++) {
            /* 13377 */
            if (getInventory(MapleInventoryType.getByType((byte) i)).getNextFreeSlot() <= -1) {
                /* 13378 */
                return false;
                /*       */
            }
            /*       */
        }
        /* 13381 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    public boolean canHoldSlots(int slot) {
        /* 13385 */
        for (int i = 1; i <= 5; i++) {
            /* 13386 */
            if (getInventory(MapleInventoryType.getByType((byte) i)).isFull(slot)) {
                /* 13387 */
                return false;
                /*       */
            }
            /*       */
        }
        /* 13390 */
        return true;
        /*       */
    }

    /*       */
    /*       */
    public boolean canHold(int itemid) {
        /* 13394 */
        return (getInventory(ItemConstants.getInventoryType(itemid)).getNextFreeSlot() > -1);
        /*       */
    }

    /*       */
    /*       */
    public long getMerchantMeso() {
        /* 13398 */
        long mesos = 0L;
        /* 13399 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13400 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM hiredmerch WHERE characterid = ?");
            /* 13401 */
            ps.setInt(1, this.id);
            /* 13402 */
            ResultSet rs = ps.executeQuery();
            /* 13403 */
            if (rs.next()) {
                /* 13404 */
                mesos = rs.getLong("Mesos");
                /*       */
            }
            /* 13406 */
            rs.close();
            /* 13407 */
            ps.close();
            /* 13408 */
        } catch (SQLException se) {
            /* 13409 */
            log.error("获取雇佣商店金币发生错误", se);
            /*       */
        }
        /* 13411 */
        return mesos;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void autoban(String reason, int greason) {
        /* 13420 */
        Calendar cal = Calendar.getInstance();
        /* 13421 */
        cal.set(cal.get(1), cal.get(2), cal.get(5) + 3, cal.get(11), cal.get(12));
        /* 13422 */
        Timestamp TS = new Timestamp(cal.getTimeInMillis());
        /* 13423 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13424 */
            PreparedStatement ps = con.prepareStatement("UPDATE accounts SET banreason = ?, tempban = ?, greason = ? WHERE id = ?");
            /* 13425 */
            ps.setString(1, reason);
            /* 13426 */
            ps.setTimestamp(2, TS);
            /* 13427 */
            ps.setInt(3, greason);
            /* 13428 */
            ps.setInt(4, this.accountid);
            /* 13429 */
            ps.executeUpdate();
            /* 13430 */
            ps.close();
            /* 13431 */
        } catch (SQLException e) {
            /* 13432 */
            log.error("Error while autoban" + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean isBanned() {
        /* 13437 */
        return this.isbanned;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void sendPolice(int greason, String reason, int duration) {
        /* 13442 */
        this.isbanned = true;
        /* 13443 */
        Timer.WorldTimer.getInstance().schedule(() -> this.client.disconnect(true, false), duration);
        /*       */
    }

    /*       */
    /*       */
    public void sendPolice(String text) {
        this.client.announce(MaplePacketCreator.sendPolice(text));
        this.isbanned = true;
        Timer.WorldTimer.getInstance().schedule(() -> {
            this.client.disconnect(true, false);
            if (this.client.getSession().isActive()) {
                this.client.getSession().close();
            }

        }, 6000L);
    }



    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Timestamp getChrCreated() {
        /* 13461 */
        if (this.createDate != null) {
            /* 13462 */
            return this.createDate;
            /*       */
        }
        /* 13464 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13465 */
            PreparedStatement ps = con.prepareStatement("SELECT createdate FROM characters WHERE id = ?");
            /* 13466 */
            ps.setInt(1, getId());
            /* 13467 */
            ResultSet rs = ps.executeQuery();
            /* 13468 */
            if (!rs.next()) {
                /* 13469 */
                rs.close();
                /* 13470 */
                ps.close();
                /* 13471 */
                return null;
                /*       */
            }
            /* 13473 */
            this.createDate = rs.getTimestamp("createdate");
            /* 13474 */
            rs.close();
            /* 13475 */
            ps.close();
            /* 13476 */
            return this.createDate;
            /* 13477 */
        } catch (SQLException e) {
            /* 13478 */
            log.error("获取角色创建日期出错", e);
            /* 13479 */
            return new Timestamp(-1L);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean isInJailMap() {
        /* 13487 */
        return (getMapId() == 180000001 && getGMLevel() == 0);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getWarning() {
        /* 13494 */
        return this.warning;
        /*       */
    }

    /*       */
    /*       */
    public void setWarning(int warning) {
        /* 13498 */
        this.warning = warning;
        /*       */
    }

    /*       */
    /*       */
    public void gainWarning(boolean warningEnabled) {
        /* 13502 */
        this.warning++;
        /* 13503 */
        WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] 截至目前玩家: " + getName() + " (等级 " + getLevel() + ") 该用户已被警告: " + this.warning + " 次！"));
        /* 13504 */
        if (warningEnabled) {
            /* 13505 */
            if (this.warning == 1) {
                /* 13506 */
                dropMessage(5, "这是你的第一次警告！请注意在游戏中勿使用非法程序！");
                /* 13507 */
            } else if (this.warning == 2) {
                /* 13508 */
                dropMessage(5, "警告现在是第 " + this.warning + " 次。如果你再得到一次警告就会封号处理！");
                /* 13509 */
            } else if (this.warning >= 3) {
                /* 13510 */
                ban(getName() + " 由于警告次数超过: " + this.warning + " 次，系统对其封号处理！", false, true, false);
                /* 13511 */
                WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(0, "[系统封号] 玩家 " + getName() + " (等级 " + getLevel() + ") 由于警告次数过多，系统对其封号处理！"));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getBeans() {
        /* 13520 */
        return this.beans;
        /*       */
    }

    /*       */
    /*       */
    public void setBeans(int i) {
        /* 13524 */
        this.beans = i;
        /*       */
    }

    /*       */
    /*       */
    public void gainBeans(int i, boolean show) {
        /* 13528 */
        this.beans += i;
        /* 13529 */
        if (show && i != 0) {
            /* 13530 */
            dropMessage(-1, "您" + ((i > 0) ? "获得了 " : "消耗了 ") + Math.abs(i) + " 个豆豆.");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int teachSkill(int toSkillId, int skillId, int toChrId, boolean notime) {
        /* 13538 */
        if (toSkillId == 80000055 || toSkillId == 80000329) {
            /* 13539 */
            return 1;
            /*       */
        }
        /* 13541 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 13542 */
            try (PreparedStatement ps = con.prepareStatement("DELETE FROM skills WHERE skillid = ? AND teachId = ?")) {
                /* 13543 */
                ps.setInt(1, skillId);
                /* 13544 */
                ps.setInt(2, toChrId);
                /* 13545 */
                ps.executeUpdate();
                /*       */
            }
            /*       */
            /* 13548 */
            try (PreparedStatement ps = con.prepareStatement("UPDATE skills SET " + (notime ? "" : "expiration = ?, ") + "teachId = ? WHERE skillid = ? AND characterid = ?")) {
                /* 13549 */
                int n5 = 0;
                /* 13550 */
                if (!notime) {
                    /* 13551 */
                    ps.setLong(++n5, System.currentTimeMillis());
                    /*       */
                }
                /* 13553 */
                ps.setInt(++n5, notime ? 0 : this.id);
                /* 13554 */
                ps.setInt(++n5, toSkillId);
                /* 13555 */
                ps.setInt(++n5, toChrId);
                /* 13556 */
                ps.executeUpdate();
                /*       */
            }
            /* 13558 */
            return 1;
            /* 13559 */
        } catch (Exception Ex) {
            /* 13560 */
            log.error("传授技能失败.", Ex);
            /* 13561 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void startLieDetector(boolean isItem) {
        /* 13569 */
        if (!getAntiMacro().inProgress()) {
            /* 13570 */
            getAntiMacro().startLieDetector(getName(), isItem, false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getReborns() {
        /* 13578 */
        return this.reborns;
        /*       */
    }

    /*       */
    /*       */
    public void setReborns(int val) {
        /* 13582 */
        this.reborns += val;
        /*       */
    }

    /*       */
    /*       */
    public int getReborns1() {
        /* 13586 */
        return this.reborns1;
        /*       */
    }

    /*       */
    /*       */
    public void setReborns1(int val) {
        /* 13590 */
        this.reborns1 += val;
        /*       */
    }

    /*       */
    /*       */
    public int getReborns2() {
        /* 13594 */
        return this.reborns2;
        /*       */
    }

    /*       */
    /*       */
    public void setReborns2(int val) {
        /* 13598 */
        this.reborns2 += val;
        /*       */
    }

    /*       */
    /*       */
    public int getReborns3() {
        /* 13602 */
        return this.reborns3;
        /*       */
    }

    /*       */
    /*       */
    public void setReborns3(int val) {
        /* 13606 */
        this.reborns3 += val;
        /*       */
    }

    /*       */
    /*       */
    public void gainReborns(int type) {
        /* 13610 */
        if (type == 0) {
            /* 13611 */
            this.reborns++;
            /* 13612 */
        } else if (type == 1) {
            /* 13613 */
            this.reborns1++;
            /* 13614 */
        } else if (type == 2) {
            /* 13615 */
            this.reborns2++;
            /* 13616 */
        } else if (type == 3) {
            /* 13617 */
            this.reborns3++;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getAPS() {
        /* 13622 */
        return this.apstorage;
        /*       */
    }

    /*       */
    /*       */
    public void gainAPS(int aps) {
        /* 13626 */
        this.apstorage += aps;
        /*       */
    }

    /*       */
    /*       */
    public void doReborn(int type) {
        /* 13630 */
        List<Pair<MapleStat, Long>> stat = new ArrayList<>(12);
        /* 13631 */
        clearSkills();
        /*       */
        /* 13633 */
        gainReborns(type);
        /*       */
        /* 13635 */
        setLevel((short) 1);
        /* 13636 */
        setExp(0L);
        /* 13637 */
        setJob(0);
        /* 13638 */
        setRemainingAp((short) 0);
        /* 13639 */
        int str = 12;
        /* 13640 */
        int dex = 5;
        /* 13641 */
        int int_ = 4;
        /* 13642 */
        int luk = 4;
        /* 13643 */
        int total = getReborns() * 5 + getReborns1() * 10 + getReborns2() * 15 + getReborns3() * 30;
        /* 13644 */
        this.stats.str = (short) str;
        /* 13645 */
        this.stats.dex = (short) dex;
        /* 13646 */
        this.stats.int_ = (short) int_;
        /* 13647 */
        this.stats.luk = (short) luk;
        /*       */
        /* 13649 */
        this.stats.setInfo(50, 50, 50, 50);
        /* 13650 */
        setRemainingAp((short) total);
        /* 13651 */
        this.stats.recalcLocalStats(this);
        /*       */
        /* 13653 */
        stat.add(new Pair(MapleStat.力量, Long.valueOf(str)));
        /* 13654 */
        stat.add(new Pair(MapleStat.敏捷, Long.valueOf(dex)));
        /* 13655 */
        stat.add(new Pair(MapleStat.智力, Long.valueOf(int_)));
        /* 13656 */
        stat.add(new Pair(MapleStat.运气, Long.valueOf(luk)));
        /* 13657 */
        stat.add(new Pair(MapleStat.AVAILABLEAP, Long.valueOf(total)));
        /* 13658 */
        stat.add(new Pair(MapleStat.MAXHP, Long.valueOf(50L)));
        /* 13659 */
        stat.add(new Pair(MapleStat.MAXMP, Long.valueOf(50L)));
        /* 13660 */
        stat.add(new Pair(MapleStat.HP, Long.valueOf(50L)));
        /* 13661 */
        stat.add(new Pair(MapleStat.MP, Long.valueOf(50L)));
        /* 13662 */
        stat.add(new Pair(MapleStat.等级, Long.valueOf(1L)));
        /* 13663 */
        stat.add(new Pair(MapleStat.职业, Long.valueOf(0L)));
        /* 13664 */
        stat.add(new Pair(MapleStat.经验, Long.valueOf(0L)));
        /*       */
        /* 13666 */
        this.client.announce(MaplePacketCreator.updatePlayerStats(stat, false, this));
        /*       */
    }

    /*       */
    /*       */
    public void doReborn(int type, int ap) {
        /* 13670 */
        List<Pair<MapleStat, Long>> stat = new ArrayList<>(12);
        /* 13671 */
        clearSkills();
        /*       */
        /* 13673 */
        gainReborns(type);
        /*       */
        /* 13675 */
        setLevel((short) 1);
        /* 13676 */
        setExp(0L);
        /* 13677 */
        setJob(0);
        /* 13678 */
        setRemainingAp((short) 0);
        /* 13679 */
        int str = 12;
        /* 13680 */
        int dex = 5;
        /* 13681 */
        int int_ = 4;
        /* 13682 */
        int luk = 4;
        /* 13683 */
        this.stats.str = (short) str;
        /* 13684 */
        this.stats.dex = (short) dex;
        /* 13685 */
        this.stats.int_ = (short) int_;
        /* 13686 */
        this.stats.luk = (short) luk;
        /*       */
        /* 13688 */
        this.stats.setInfo(50, 50, 50, 50);
        /* 13689 */
        setRemainingAp((short) ap);
        /* 13690 */
        this.stats.recalcLocalStats(this);
        /*       */
        /* 13692 */
        stat.add(new Pair(MapleStat.力量, Long.valueOf(str)));
        /* 13693 */
        stat.add(new Pair(MapleStat.敏捷, Long.valueOf(dex)));
        /* 13694 */
        stat.add(new Pair(MapleStat.智力, Long.valueOf(int_)));
        /* 13695 */
        stat.add(new Pair(MapleStat.运气, Long.valueOf(luk)));
        /* 13696 */
        stat.add(new Pair(MapleStat.AVAILABLEAP, Long.valueOf(ap)));
        /* 13697 */
        stat.add(new Pair(MapleStat.MAXHP, Long.valueOf(50L)));
        /* 13698 */
        stat.add(new Pair(MapleStat.MAXMP, Long.valueOf(50L)));
        /* 13699 */
        stat.add(new Pair(MapleStat.HP, Long.valueOf(50L)));
        /* 13700 */
        stat.add(new Pair(MapleStat.MP, Long.valueOf(50L)));
        /* 13701 */
        stat.add(new Pair(MapleStat.等级, Long.valueOf(1L)));
        /* 13702 */
        stat.add(new Pair(MapleStat.职业, Long.valueOf(0L)));
        /* 13703 */
        stat.add(new Pair(MapleStat.经验, Long.valueOf(0L)));
        /*       */
        /* 13705 */
        this.client.announce(MaplePacketCreator.updatePlayerStats(stat, false, this));
        /*       */
    }

    /*       */
    /*       */
    public void clearSkills() {
        /* 13709 */
        Map<Integer, SkillEntry> chrSkill = new HashMap<>(getSkills());
        /* 13710 */
        Map<Integer, SkillEntry> newList = new HashMap<>();
        /* 13711 */
        for (Map.Entry<Integer, SkillEntry> skill : chrSkill.entrySet()) {
            /* 13712 */
            newList.put(skill.getKey(), new SkillEntry(0, (byte) 0, -1L));
            /*       */
        }
        /* 13714 */
        changeSkillsLevel(newList);
        /* 13715 */
        newList.clear();
        /* 13716 */
        chrSkill.clear();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<Integer, Byte> getSkillsWithPos() {
        /* 13723 */
        Map<Integer, SkillEntry> chrskills = new HashMap<>(getSkills());
        /* 13724 */
        Map<Integer, Byte> skillsWithPos = new LinkedHashMap<>();
        /* 13725 */
        for (Map.Entry<Integer, SkillEntry> skill : chrskills.entrySet()) {
            /* 13726 */
            if (((SkillEntry) skill.getValue()).position >= 0 && ((SkillEntry) skill.getValue()).position <= 15) {
                /* 13727 */
                skillsWithPos.put(skill.getKey(), Byte.valueOf(((SkillEntry) skill.getValue()).position));
                /*       */
            }
            /*       */
        }
        /* 13730 */
        return skillsWithPos;
        /*       */
    }

    /*       */
    /*       */
    public int getStealMemorySkill(int position) {
        /* 13734 */
        int skillId = 0;
        /* 13735 */
        Map<Integer, Byte> skillsWithPos = getSkillsWithPos();
        /* 13736 */
        for (Map.Entry<Integer, Byte> x : skillsWithPos.entrySet()) {
            /* 13737 */
            if (((Byte) x.getValue()).byteValue() == position) {
                /* 13738 */
                skillId = ((Integer) x.getKey()).intValue();
                /*       */
                break;
                /*       */
            }
            /*       */
        }
        /* 13742 */
        return skillId;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int 获取幻影装备技能(int skillid) {
        /* 13749 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skillid));
        /* 13750 */
        if (ret == null || ret.teachId == 0) {
            /* 13751 */
            return 0;
            /*       */
        }
        /* 13753 */
        return (this.skills.get(Integer.valueOf(ret.teachId)) != null) ? ret.teachId : 0;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void 修改幻影装备技能(int skillId, int teachId) {
        /* 13760 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skillId));
        /* 13761 */
        if (ret != null) {
            /* 13762 */
            Skill theskill = SkillFactory.getSkill(ret.teachId);
            /* 13763 */
            if (theskill != null && theskill.isBuffSkill()) {
                /* 13764 */
                cancelEffect(theskill.getEffect(1), false, -1L);
                /*       */
            }
            /* 13766 */
            ret.teachId = teachId;
            /* 13767 */
            this.changed_skills = true;
            /* 13768 */
            this.client.announce(MaplePacketCreator.修改幻影装备技能(skillId, teachId));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void 幻影删除技能(int skillId) {
        /* 13773 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skillId));
        /* 13774 */
        if (ret != null) {
            /* 13775 */
            this.skills.remove(Integer.valueOf(skillId));
            /* 13776 */
            this.client.announce(MaplePacketCreator.幻影删除技能(ret.position));
            /* 13777 */
            this.changed_skills = true;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void 幻影技能复制(int skillBook, int skillId, int level) {
        /* 13782 */
        int skillLevel = 0;
        /* 13783 */
        if (skillBook == 1) {
            /* 13784 */
            skillLevel = getSkillLevel(24001001);
            /* 13785 */
        } else if (skillBook == 2) {
            /* 13786 */
            skillLevel = getSkillLevel(24101001);
            /* 13787 */
        } else if (skillBook == 3) {
            /* 13788 */
            skillLevel = getSkillLevel(24111001);
            /* 13789 */
        } else if (skillBook == 4) {
            /* 13790 */
            skillLevel = getSkillLevel(24121001);
            /* 13791 */
        } else if (skillBook == 5) {
            /* 13792 */
            skillLevel = getSkillLevel(24121054);
            /*       */
        }
        /* 13794 */
        Skill theskill = SkillFactory.getSkill(skillId);
        /* 13795 */
        if (level > skillLevel) {
            /* 13796 */
            skillLevel = level;
            /*       */
        }
        /* 13798 */
        if (skillLevel > theskill.getMaxLevel()) {
            /* 13799 */
            skillLevel = theskill.getMaxLevel();
            /*       */
        }
        /* 13801 */
        SkillEntry ret = this.skills.get(Integer.valueOf(skillId));
        /* 13802 */
        if (ret != null) {
            /* 13803 */
            ret.skillevel = skillLevel;
            /* 13804 */
            this.changed_skills = true;
            /* 13805 */
            this.client.announce(MaplePacketCreator.幻影复制技能(ret.position, skillId, skillLevel));
            /* 13806 */
        } else if (skillBook == 1) {
            /* 13807 */
            for (int i = 0; i < 4; i++) {
                /* 13808 */
                if (getStealMemorySkill(i) == 0) {
                    /* 13809 */
                    this.skills.put(Integer.valueOf(skillId), new SkillEntry(skillLevel, (byte) theskill.getMasterLevel(), -1L, 0, (byte) i));
                    /* 13810 */
                    this.changed_skills = true;
                    /* 13811 */
                    this.client.announce(MaplePacketCreator.幻影复制技能(i, skillId, skillLevel));
                    /*       */
                    break;
                    /*       */
                }
                /*       */
            }
            /* 13815 */
        } else if (skillBook == 2) {
            /* 13816 */
            for (int i = 4; i < 8; i++) {
                /* 13817 */
                if (getStealMemorySkill(i) == 0) {
                    /* 13818 */
                    this.skills.put(Integer.valueOf(skillId), new SkillEntry(skillLevel, (byte) theskill.getMasterLevel(), -1L, 0, (byte) i));
                    /* 13819 */
                    this.changed_skills = true;
                    /* 13820 */
                    this.client.announce(MaplePacketCreator.幻影复制技能(i, skillId, skillLevel));
                    /*       */
                    break;
                    /*       */
                }
                /*       */
            }
            /* 13824 */
        } else if (skillBook == 3) {
            /* 13825 */
            for (int i = 8; i < 11; i++) {
                /* 13826 */
                if (getStealMemorySkill(i) == 0) {
                    /* 13827 */
                    this.skills.put(Integer.valueOf(skillId), new SkillEntry(skillLevel, (byte) theskill.getMasterLevel(), -1L, 0, (byte) i));
                    /* 13828 */
                    this.changed_skills = true;
                    /* 13829 */
                    this.client.announce(MaplePacketCreator.幻影复制技能(i, skillId, skillLevel));
                    /*       */
                    break;
                    /*       */
                }
                /*       */
            }
            /* 13833 */
        } else if (skillBook == 4) {
            /* 13834 */
            for (int i = 11; i < 13; i++) {
                /* 13835 */
                if (getStealMemorySkill(i) == 0) {
                    /* 13836 */
                    this.skills.put(Integer.valueOf(skillId), new SkillEntry(skillLevel, (byte) theskill.getMasterLevel(), -1L, 0, (byte) i));
                    /* 13837 */
                    this.changed_skills = true;
                    /* 13838 */
                    this.client.announce(MaplePacketCreator.幻影复制技能(i, skillId, skillLevel));
                    /*       */
                    break;
                    /*       */
                }
                /*       */
            }
            /* 13842 */
        } else if (skillBook == 5) {
            /* 13843 */
            for (int i = 13; i < 15; i++) {
                /* 13844 */
                if (getStealMemorySkill(i) == 0) {
                    /* 13845 */
                    this.skills.put(Integer.valueOf(skillId), new SkillEntry(skillLevel, (byte) theskill.getMasterLevel(), -1L, 0, (byte) i));
                    /* 13846 */
                    this.changed_skills = true;
                    /* 13847 */
                    this.client.announce(MaplePacketCreator.幻影复制技能(i, skillId, skillLevel));
                    /*       */
                    break;
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MapleCharacterCards getCharacterCard() {
        /* 13858 */
        return this.characterCard;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public InnerSkillEntry[] getInnerSkills() {
        /* 13865 */
        return this.innerSkills;
        /*       */
    }

    /*       */
    /*       */
    public int getInnerSkillSize() {
        /* 13869 */
        int ret = 0;
        /* 13870 */
        for (int i = 0; i < 3; i++) {
            /* 13871 */
            if (this.innerSkills[i] != null) {
                /* 13872 */
                ret++;
                /*       */
            }
            /*       */
        }
        /* 13875 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    public int getInnerSkillIdByPos(int position) {
        /* 13879 */
        if (this.innerSkills[position] != null) {
            /* 13880 */
            return this.innerSkills[position].getSkillId();
            /*       */
        }
        /* 13882 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public int getHonor() {
        /* 13886 */
        return this.honor;
        /*       */
    }

    /*       */
    /*       */
    public void setHonor(int exp) {
        /* 13890 */
        this.honor = exp;
        /*       */
    }

    /*       */
    /*       */
    public void gainHonor(int amount) {
        /* 13894 */
        if (amount > 0) {
            /* 13895 */
            dropMessage(-9, "声望" + amount + "已获得。");
            /*       */
        }
        /* 13897 */
        this.honor += amount;
        /* 13898 */
        this.client.announce(MaplePacketCreator.updateInnerStats(this));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkInnerSkill() {
        /* 13906 */
        if (this.level >= 30 && this.innerSkills[0] == null) {
            /* 13907 */
            changeInnerSkill(new InnerSkillEntry(70000000, 1, (byte) 1, (byte) 0));
            /*       */
        }
        /* 13909 */
        if (this.level >= 40 && this.innerSkills[1] == null) {
            /* 13910 */
            changeInnerSkill(new InnerSkillEntry(70000001, 3, (byte) 2, (byte) 0));
            /*       */
        }
        /* 13912 */
        if (this.level >= 50 && this.innerSkills[2] == null) {
            /* 13913 */
            changeInnerSkill(new InnerSkillEntry(70000002, 5, (byte) 3, (byte) 0));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeInnerSkill(InnerSkillEntry data) {
        /* 13921 */
        changeInnerSkill(data.getSkillId(), data.getSkillLevel(), data.getPosition(), data.getRank());
        /*       */
    }

    /*       */
    /*       */
    public void changeInnerSkill(int skillId, int skillevel, byte position, byte rank) {
        /* 13925 */
        Skill skill = SkillFactory.getSkill(skillId);
        /* 13926 */
        if (skill == null || !skill.isInnerSkill() || skillevel <= 0 || position > 3 || position < 1) {
            /*       */
            return;
            /*       */
        }
        /* 13929 */
        if (skillevel > skill.getMaxLevel()) {
            /* 13930 */
            skillevel = skill.getMaxLevel();
            /*       */
        }
        /* 13932 */
        InnerSkillEntry InnerSkill = new InnerSkillEntry(skillId, skillevel, position, rank);
        /* 13933 */
        this.innerSkills[position - 1] = InnerSkill;
        /* 13934 */
        this.client.announce(MaplePacketCreator.updateInnerSkill(skillId, skillevel, position, rank));
        /* 13935 */
        this.changed_innerSkills = true;
        /*       */
    }

    /*       */
    /*       */
    public void checkHyperAP() {
        /* 13939 */
        if (this.level >= 140) {
            /*       */
            /* 13941 */
            Map<Integer, SkillEntry> list = new HashMap<>();
            /* 13942 */
            for (int i = 80000400; i <= 80000417; i++) {
                /* 13943 */
                Skill skil = SkillFactory.getSkill(i);
                /* 13944 */
                if (skil != null && getSkillLevel(skil) <= 0) {
                    /* 13945 */
                    list.put(Integer.valueOf(i), new SkillEntry(0, (byte) skil.getMaxLevel(), -1L));
                    /*       */
                }
                /*       */
            }
            /* 13948 */
            if (!list.isEmpty()) {
                /* 13949 */
                changeSkillsLevel(list);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handleKillSpreeGain() {
        /* 13958 */
        Skill skill = SkillFactory.getSkill(4221013);
        /* 13959 */
        int skillLevel = getSkillLevel(skill);
        /* 13960 */
        int killSpree = getBuffedIntValue(MapleBuffStat.击杀点数);
        /* 13961 */
        if (skillLevel <= 0 || killSpree >= 5) {
            /*       */
            return;
            /*       */
        }
        /* 13964 */
        if (Randomizer.nextInt(100) <= 20) {
            /* 13965 */
            skill.getEffect(skillLevel).applyTo(this, true);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle元素雷电(int skillId) {
        /* 13974 */
        if (skillId == 15111022 || skillId == 15121001 || skillId == 15120003) {
            /*       */
            return;
            /*       */
        }
        /* 13977 */
        Skill skill = SkillFactory.getSkill(15001022);
        /* 13978 */
        int skillLevel = getSkillLevel(skill);
        /* 13979 */
        if (skillLevel <= 0 || getBuffedValue(MapleBuffStat.元素属性) == null) {
            /*       */
            return;
            /*       */
        }
        /* 13982 */
        if (Randomizer.nextInt(100) <= (getStat()).raidenPorp) {
            /* 13983 */
            skill.getEffect(skillLevel).applyTo(this, true);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle元素冲击(int skillId) {
        /*       */
        MapleStatEffect effect;
        /* 13992 */
        Skill skill_2 = SkillFactory.getSkill(1200014);
        /* 13993 */
        Skill skill_4 = SkillFactory.getSkill(1220010);
        /*       */
        /* 13995 */
        if (getSkillLevel(skill_4) > 0) {
            /* 13996 */
            effect = skill_4.getEffect(getTotalSkillLevel(skill_4));
            /* 13997 */
        } else if (getSkillLevel(skill_2) > 0) {
            /* 13998 */
            effect = skill_2.getEffect(getTotalSkillLevel(skill_2));
            /*       */
        } else {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 14003 */
        Element newElement = null;
        /* 14004 */
        switch (skillId) {
            /*       */
            case 1201011:
                /* 14006 */
                newElement = Element.火;
                /*       */
                break;
            /*       */
            case 1201012:
                /* 14009 */
                newElement = Element.冰;
                /*       */
                break;
            /*       */
            case 1211008:
                /* 14012 */
                newElement = Element.雷;
                /*       */
                break;
            /*       */
            case 1221004:
                /* 14015 */
                newElement = Element.神圣;
                /*       */
                break;
            /*       */
        }
        /* 14018 */
        if (newElement == null) {
            /*       */
            return;
            /*       */
        }
        /* 14021 */
        if (this.elements == null) {
            /* 14022 */
            this.elements = newElement;
            /*       */
            return;
            /*       */
        }
        /* 14025 */
        boolean change = (this.elements != newElement);
        /* 14026 */
        if (change) {
            /* 14027 */
            this.elements = newElement;
            /* 14028 */
            MapleBuffStat buffStat = MapleBuffStat.元素冲击;
            /* 14029 */
            int buffSourceId = getBuffSource(buffStat);
            /* 14030 */
            if (getBuffedValue(buffStat) == null || buffSourceId != effect.getSourceid()) {
                /* 14031 */
                effect.applyTo(this, true);
                /*       */
                return;
                /*       */
            }
            /* 14034 */
            int count = Math.min(getBuffedIntValue(buffStat) / 5, 5);
            /* 14035 */
            if (count < 5) {
                /* 14036 */
                count++;
                /*       */
            }
            /* 14038 */
            if (isShowPacket()) {
                /* 14039 */
                dropSpouseMessage(10, "当前元素冲击数: " + count);
                /*       */
            }
            /* 14041 */
            Map<MapleBuffStat, Integer> stat = Collections.singletonMap(buffStat, Integer.valueOf(count * 5));
            /* 14042 */
            setBuffedValue(buffStat, count * 5);
            /* 14043 */
            int duration = effect.getDuration();
            /* 14044 */
            this.client.announce(BuffPacket.giveBuff(effect.getSourceid(), duration, stat, effect, this));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public static void handleElementalCharge(MapleCharacter player, int skillId) {
        /* 14049 */
        if ((((skillId != 1201011) ? 1 : 0) & ((skillId != 1201012) ? 1 : 0) & ((skillId != 1211008) ? 1 : 0) & ((skillId != 1221004) ? 1 : 0)) != 0) {
            /*       */
            return;
            /*       */
        }
        /* 14052 */
        if (player.getLastSkill() == skillId || player.getLastSkill() == 0) {
            /* 14053 */
            player.setLastSkill(skillId);
            /*       */
            /*       */
            return;
            /*       */
        }
        /* 14057 */
        int newSkill = (player.getTotalSkillLevel(1220010) > 0) ? 1220010 : 1200014;
        /*       */
        /* 14059 */
        player.setLastSkill(skillId);
        /*       */
        /*       */
        /* 14062 */
        player.getSkillEffect(newSkill).applyTo(player, true);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle提速时刻() {
        /* 14070 */
        Skill skill = SkillFactory.getSkill(isZeroSecondLook() ? 100000277 : 100000276);
        /* 14071 */
        int skillLevel = 1;
        /* 14072 */
        skill.getEffect(skillLevel).applyTo(this, true);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void handleHeartMineUnity() {
        /* 14077 */
        Skill skill = SkillFactory.getSkill(400051007);
        MapleStatEffect effect;
        /* 14078 */
        if (getSkillLevel(400051007) > 0 && getBuffedIntValue(MapleBuffStat.心雷合一) > 0 && (effect = skill.getEffect(getSkillLevel(400051007))) != null) {
            /* 14079 */
            int n2 = effect.getX();
            /* 14080 */
            List<MapleMapObject> list = getMap().getMonstersInRange(getTruePosition(), 100000.0D);
            /* 14081 */
            ArrayList<Integer> arrayList = new ArrayList<>();
            /* 14082 */
            list.forEach(y2 -> {
                /*       */
                MapleMonster monster = (MapleMonster) y2;
                /*       */
                if (!monster.getStats().isFriendly() && !monster.isFake() && arrayList.size() < n2) {
                    /*       */
                    arrayList.add(Integer.valueOf(y2.getObjectId()));
                    /*       */
                }
                /*       */
            });
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public String getMedalText() {
        /* 14098 */
        String medal = "";
        /* 14099 */
        Item medalItem = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -26);
        /* 14100 */
        if (medalItem != null) {
            /* 14101 */
            medal = "<" + MapleItemInformationProvider.getInstance().getName(medalItem.getItemId()) + "> ";
            /*       */
        }
        /* 14103 */
        return medal;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getGamePoints() {
        /* 14110 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 14111 */
            int gamePoints = 0;
            /* 14112 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM accounts_info WHERE accId = ? AND worldId = ?");
            /* 14113 */
            ps.setInt(1, getAccountID());
            /* 14114 */
            ps.setInt(2, getWorld());
            /* 14115 */
            ResultSet rs = ps.executeQuery();
            /* 14116 */
            if (rs.next()) {
                /* 14117 */
                gamePoints = rs.getInt("gamePoints");
                /* 14118 */
                Timestamp updateTime = rs.getTimestamp("updateTime");
                /* 14119 */
                Calendar sqlcal = Calendar.getInstance();
                /* 14120 */
                if (updateTime != null) {
                    /* 14121 */
                    sqlcal.setTimeInMillis(updateTime.getTime());
                    /*       */
                }
                /* 14123 */
                if (sqlcal.get(5) + 1 <= Calendar.getInstance().get(5) || sqlcal.get(2) + 1 <= Calendar.getInstance().get(2) || sqlcal.get(1) + 1 <= Calendar.getInstance().get(1)) {
                    /* 14124 */
                    gamePoints = 0;
                    /* 14125 */
                    PreparedStatement psu = con.prepareStatement("UPDATE accounts_info SET gamePoints = 0, updateTime = CURRENT_TIMESTAMP() WHERE accId = ? AND worldId = ?");
                    /* 14126 */
                    psu.setInt(1, getAccountID());
                    /* 14127 */
                    psu.setInt(2, getWorld());
                    /* 14128 */
                    psu.executeUpdate();
                    /* 14129 */
                    psu.close();
                    /*       */
                }
                /*       */
            } else {
                /* 14132 */
                PreparedStatement psu = con.prepareStatement("INSERT INTO accounts_info (accId, worldId, gamePoints) VALUES (?, ?, ?)");
                /* 14133 */
                psu.setInt(1, getAccountID());
                /* 14134 */
                psu.setInt(2, getWorld());
                /* 14135 */
                psu.setInt(3, 0);
                /* 14136 */
                psu.executeUpdate();
                /* 14137 */
                psu.close();
                /*       */
            }
            /* 14139 */
            rs.close();
            /* 14140 */
            ps.close();
            /* 14141 */
            return gamePoints;
            /* 14142 */
        } catch (Exception Ex) {
            /* 14143 */
            log.error("获取角色帐号的在线时间点出现错误 - 数据库查询失败", Ex);
            /* 14144 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void gainGamePoints(int amount) {
        /* 14149 */
        int gamePoints = getGamePoints() + amount;
        /* 14150 */
        updateGamePoints(gamePoints);
        /*       */
    }

    /*       */
    /*       */
    public void resetGamePoints() {
        /* 14154 */
        updateGamePoints(0);
        /*       */
    }

    /*       */
    /*       */
    public void updateGamePoints(int amount) {
        /* 14158 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 14159 */         PreparedStatement ps = con.prepareStatement("UPDATE accounts_info SET gamePoints = ?, updateTime = CURRENT_TIMESTAMP() WHERE accId = ? AND worldId = ?")) {
            /* 14160 */
            ps.setInt(1, amount);
            /* 14161 */
            ps.setInt(2, getAccountID());
            /* 14162 */
            ps.setInt(3, getWorld());
            /* 14163 */
            ps.executeUpdate();
            /*       */
        }
        /* 14165 */ catch (Exception Ex) {
            /* 14166 */
            log.error("更新角色帐号的在线时间出现错误 - 数据库更新失败.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getMaxLevelForSever() {
        /* 14174 */
        return ServerConfig.CHANNEL_PLAYER_MAXLEVEL;
        /*       */
    }

    /*       */
    /*       */
    public int getMaxHpForSever() {
        /* 14178 */
        return ServerConfig.CHANNEL_PLAYER_MAXHP;
        /*       */
    }

    /*       */
    /*       */
    public int getMaxMpForSever() {
        /* 14182 */
        return ServerConfig.CHANNEL_PLAYER_MAXMP;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public long getMaxDamageOver(int skillId) {
        /* 14192 */
        long maxDamage = 10000000000L;
        /*       */
        /* 14194 */
        long limitBreak = getStat().getLimitBreak(this);
        /* 14195 */
        int incMaxDamage = (getStat()).incMaxDamage;
        /*       */
        Skill skill;
        /* 14197 */
        if (skillId <= 0 || (skill = SkillFactory.getSkill(skillId)) == null)
            /* 14198 */ return ((limitBreak > maxDamage) ? limitBreak : maxDamage) + incMaxDamage;
        /* 14199 */
        if (skillId == 80001770)
            /* 14200 */ return maxDamage;
        /* 14201 */
        long skillMaxDamage = skill.getMaxDamageOver();
        /* 14202 */
        if (skillId == 4221014 && getTotalSkillLevel(4220051) > 0) {
            /* 14203 */
            skillMaxDamage = 60000000L;
            /* 14204 */
        } else if (skillId == 27121303) {
            /* 14205 */
            skillMaxDamage = maxDamage;
            /*       */
        }
        /* 14207 */
        return ((limitBreak > skillMaxDamage) ? limitBreak : skillMaxDamage) + incMaxDamage;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addTraitExp(int exp) {
        /* 14214 */
        ((MapleTrait) this.traits.get(MapleTraitType.craft)).addExp(exp, this);
        /*       */
    }

    /*       */
    /*       */
    public void setTraitExp(int exp) {
        /* 14218 */
        ((MapleTrait) this.traits.get(MapleTraitType.craft)).addExp(exp, this);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getLove() {
        /* 14225 */
        return this.love;
        /*       */
    }

    /*       */
    /*       */
    public void setLove(int love) {
        /* 14229 */
        this.love = love;
        /*       */
    }

    /*       */
    /*       */
    public void addLove(int loveChange) {
        /* 14233 */
        this.love += loveChange;
        /* 14234 */
        MessengerRankingWorker.getInstance().updateRankFromPlayer(this);
        /*       */
    }

    /*       */
    /*       */
    public long getLastLoveTime() {
        /* 14238 */
        return this.lastlovetime;
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, Long> getLoveCharacters() {
        /* 14242 */
        return this.lastdayloveids;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int canGiveLove(MapleCharacter from) {
        /* 14251 */
        if (from == null || this.lastdayloveids == null) {
            /* 14252 */
            return 1;
            /*       */
        }
        /* 14254 */
        if (this.lastdayloveids.containsKey(Integer.valueOf(from.getId()))) {
            /* 14255 */
            long lastTime = ((Long) this.lastdayloveids.get(Integer.valueOf(from.getId()))).longValue();
            /* 14256 */
            if (lastTime >= System.currentTimeMillis() - 86400000L) {
                /* 14257 */
                return 2;
                /*       */
            }
            /* 14259 */
            return 0;
            /*       */
        }
        /*       */
        /* 14262 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public void hasGiveLove(MapleCharacter to) {
        /* 14266 */
        this.lastlovetime = System.currentTimeMillis();
        /* 14267 */
        if (this.lastdayloveids.containsKey(Integer.valueOf(to.getId()))) {
            /* 14268 */
            this.lastdayloveids.remove(Integer.valueOf(to.getId()));
            /*       */
        }
        /* 14270 */
        this.lastdayloveids.put(Integer.valueOf(to.getId()), Long.valueOf(System.currentTimeMillis()));
        /* 14271 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 14272 */
            PreparedStatement ps = con.prepareStatement("INSERT INTO lovelog (characterid, characterid_to) VALUES (?, ?)");
            /* 14273 */
            ps.setInt(1, getId());
            /* 14274 */
            ps.setInt(2, to.getId());
            /* 14275 */
            ps.execute();
            /* 14276 */
            ps.close();
            /* 14277 */
        } catch (SQLException e) {
            /* 14278 */
            System.err.println("ERROR writing lovelog for char " + getName() + " to " + to.getName() + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public long getExpNeededForLevel() {
        /* 14286 */
        return GameConstants.getExpNeededForLevel(this.level);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getPlayerStats() {
        /* 14293 */
        return getHpApUsed() + this.stats.getStr() + this.stats.getDex() + this.stats.getLuk() + this.stats.getInt() + getRemainingAp();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getMaxStats(boolean hpap) {
        /* 14298 */
        int total = 29;
        /*       */
        /* 14300 */
        if (!JobConstants.is新手职业(this.job)) {
            /* 14301 */
            int jobSp = 0;
            /* 14302 */
            if (JobConstants.isSeparatedSpJob(this.job)) {
                /* 14303 */
                jobSp = JobConstants.getSkillBookByJob(this.job) * 5;
                /*       */
            } else {
                /* 14305 */
                jobSp += hpap ? 15 : 0;
                /*       */
            }
            /* 14307 */
            total += jobSp;
            /*       */
        }
        /*       */
        /* 14310 */
        if (JobConstants.is炎术士(this.job) || JobConstants.is夜行者(this.job)) {
            /* 14311 */
            if (this.level <= 70) {
                /* 14312 */
                total += getLevel() * 6;
                /*       */
            } else {
                /* 14314 */
                total += 420;
                /* 14315 */
                total += (this.level - 70) * 5;
                /*       */
            }
            /*       */
        } else {
            /* 14318 */
            total += this.level * 5;
            /*       */
        }
        /*       */
        /* 14321 */
        if (hpap) {
            /* 14322 */
            total += getHpApUsed();
            /*       */
        } else {
            /* 14324 */
            total -= getHpApUsed();
            /*       */
        }
        /* 14326 */
        return total;
        /*       */
    }

    /*       */
    /*       */
    public boolean checkMaxStat() {
        /* 14330 */
        return (getGMLevel() <= 0 && getLevel() >= 10 && getPlayerStats() > getMaxStats(true) + 15);
        /*       */
    }

    /*       */
    /*       */
    public void resetStats(int str, int dex, int int_, int luk) {
        /* 14334 */
        resetStats(str, dex, int_, luk, false);
        /*       */
    }

    /*       */
    /*       */
    public void resetStats(int str, int dex, int int_, int luk, boolean resetAll) {
        /* 14338 */
        List<Pair<MapleStat, Long>> stat = new ArrayList<>(5);
        /* 14339 */
        int total = this.stats.getStr() + this.stats.getDex() + this.stats.getLuk() + this.stats.getInt() + getRemainingAp();
        /* 14340 */
        if (resetAll) {
            /* 14341 */
            total = getMaxStats(false);
            /*       */
        }
        /* 14343 */
        total -= str;
        /* 14344 */
        this.stats.str = (short) str;
        /* 14345 */
        total -= dex;
        /* 14346 */
        this.stats.dex = (short) dex;
        /* 14347 */
        total -= int_;
        /* 14348 */
        this.stats.int_ = (short) int_;
        /* 14349 */
        total -= luk;
        /* 14350 */
        this.stats.luk = (short) luk;
        /*       */
        /* 14352 */
        setRemainingAp((short) total);
        /* 14353 */
        this.stats.recalcLocalStats(this);
        /*       */
        /* 14355 */
        stat.add(new Pair(MapleStat.力量, Long.valueOf(str)));
        /* 14356 */
        stat.add(new Pair(MapleStat.敏捷, Long.valueOf(dex)));
        /* 14357 */
        stat.add(new Pair(MapleStat.智力, Long.valueOf(int_)));
        /* 14358 */
        stat.add(new Pair(MapleStat.运气, Long.valueOf(luk)));
        /* 14359 */
        stat.add(new Pair(MapleStat.AVAILABLEAP, Long.valueOf(total)));
        /*       */
        /* 14361 */
        this.client.announce(MaplePacketCreator.updatePlayerStats(stat, false, this));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void spReset() {
        /*       */
        int[] spToGive;
        /* 14369 */
        Map<Integer, SkillEntry> oldList = new HashMap<>(getSkills());
        /* 14370 */
        Map<Integer, SkillEntry> newList = new HashMap<>();
        /* 14371 */
        for (Map.Entry<Integer, SkillEntry> toRemove : oldList.entrySet()) {
            /* 14372 */
            Skill skill = SkillFactory.getSkill(((Integer) toRemove.getKey()).intValue());
            /* 14373 */
            if (!skill.isBeginnerSkill() && !skill.isSpecialSkill() && !skill.isHyperSkill()) {
                /* 14374 */
                int skillLevel = getSkillLevel(((Integer) toRemove.getKey()).intValue());
                /* 14375 */
                if (skillLevel > 0) {
                    /* 14376 */
                    if (skill.canBeLearnedBy(getJob())) {
                        /* 14377 */
                        newList.put(toRemove.getKey(), new SkillEntry(0, ((SkillEntry) toRemove.getValue()).masterlevel, ((SkillEntry) toRemove.getValue()).expiration));
                        continue;
                        /*       */
                    }
                    /* 14379 */
                    newList.put(toRemove.getKey(), new SkillEntry(0, (byte) 0, -1L));
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
        /* 14384 */
        if (!newList.isEmpty()) {
            /* 14385 */
            changeSkillsLevel(newList);
            /*       */
        }
        /* 14387 */
        oldList.clear();
        /* 14388 */
        newList.clear();
        /*       */
        /* 14390 */
        if (JobConstants.is暗影双刀(getJob())) {
            /* 14391 */
            spToGive = new int[6];
            /* 14392 */
            if (getLevel() > 100) {
                /* 14393 */
                spToGive[5] = (getLevel() - 100) * 3 + 4;
                /* 14394 */
                spToGive[4] = 100;
                /* 14395 */
                spToGive[3] = 55;
                /* 14396 */
                spToGive[2] = 65;
                /* 14397 */
                spToGive[1] = 35;
                /* 14398 */
                spToGive[0] = 35;
                /* 14399 */
            } else if (getLevel() > 70 && getLevel() <= 100) {
                /* 14400 */
                spToGive[4] = (getLevel() - 70) * 3 + 4;
                /* 14401 */
                spToGive[3] = 49;
                /* 14402 */
                spToGive[2] = 49;
                /* 14403 */
                spToGive[1] = 34;
                /* 14404 */
                spToGive[0] = 35;
                /* 14405 */
            } else if (getLevel() > 55 && getLevel() <= 70) {
                /* 14406 */
                spToGive[3] = (getLevel() - 55) * 3 + 4;
                /* 14407 */
                spToGive[2] = 49;
                /* 14408 */
                spToGive[1] = 34;
                /* 14409 */
                spToGive[0] = 35;
                /* 14410 */
            } else if (getLevel() > 30 && getLevel() <= 55) {
                /* 14411 */
                spToGive[2] = (getLevel() - 30) * 3 + 4;
                /* 14412 */
                spToGive[1] = 34;
                /* 14413 */
                spToGive[0] = 35;
                /* 14414 */
            } else if (getLevel() > 20 && getLevel() <= 30) {
                /* 14415 */
                spToGive[1] = (getLevel() - 20) * 3 + 4;
                /* 14416 */
                spToGive[0] = 35;
                /* 14417 */
            } else if (getLevel() > 10 && getLevel() <= 20) {
                /* 14418 */
                spToGive[0] = (getLevel() - 10) * 3 + 5;
                /*       */
            }
            /* 14420 */
        } else if (JobConstants.is神之子(getJob())) {
            /* 14421 */
            spToGive = new int[2];
            /* 14422 */
            if (getLevel() >= 100) {
                /* 14423 */
                spToGive[0] = (getLevel() - 100) * 3 + 8;
                /* 14424 */
                spToGive[1] = (getLevel() - 100) * 3 + 8;
                /*       */
            }
            /* 14426 */
        } else if (JobConstants.isSeparatedSpJob(getJob())) {
            /* 14427 */
            spToGive = new int[4];
            /* 14428 */
            boolean isMagicJob = (getJob() >= 200 && getJob() <= 232);
            /* 14429 */
            if (getLevel() > 100) {
                /* 14430 */
                spToGive[3] = (getLevel() - 100) * 3 + 4;
                /* 14431 */
                spToGive[2] = 124;
                /* 14432 */
                spToGive[1] = 95;
                /* 14433 */
                spToGive[0] = 65 + (isMagicJob ? 6 : 0);
                /* 14434 */
            } else if (getLevel() > 60 && getLevel() <= 100) {
                /* 14435 */
                spToGive[2] = (getLevel() - 60) * 3 + 4;
                /* 14436 */
                spToGive[1] = 95;
                /* 14437 */
                spToGive[0] = 65 + (isMagicJob ? 6 : 0);
                /* 14438 */
            } else if (getLevel() > 30 && getLevel() <= 60) {
                /* 14439 */
                spToGive[1] = (getLevel() - 30) * 3 + 5;
                /* 14440 */
                spToGive[0] = 65 + (isMagicJob ? 6 : 0);
                /* 14441 */
            } else if (getLevel() > 10 && getLevel() <= 30) {
                /* 14442 */
                spToGive[0] = (getLevel() - 10) * 3 + 5;
                /*       */
            }
            /*       */
        } else {
            /* 14445 */
            spToGive = new int[1];
            /* 14446 */
            spToGive[0] = spToGive[0] + ((getJob() % 100 != 0 && getJob() % 100 != 1) ? (getJob() % 10 + 3) : 0);
            /* 14447 */
            if (getJob() % 10 >= 2) {
                /* 14448 */
                spToGive[0] = spToGive[0] + 3;
                /*       */
            }
            /* 14450 */
            spToGive[0] = spToGive[0] + (getLevel() - 10) * 3;
            /*       */
        }
        /* 14452 */
        for (int i = 0; i < spToGive.length; i++) {
            /* 14453 */
            setRemainingSp(spToGive[i], i);
            /*       */
        }
        /* 14455 */
        updateSingleStat(MapleStat.AVAILABLESP, 0L);
        /* 14456 */
        this.client.announce(MaplePacketCreator.enableActions());
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle雷神长枪() {
        /* 14464 */
        Skill skill = SkillFactory.getSkill(400051044);
        /* 14465 */
        int skillLevel = getSkillLevel(skill);
        /* 14466 */
        if (skillLevel > 0) {
            /* 14467 */
            MapleStatEffect effect = skill.getEffect(skillLevel);
            /*       */
            /* 14469 */
            if (effect != null && Randomizer.nextInt(100) < 35) {
                /* 14470 */
                effect.applyTo(this, true);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getPlayerPoints() {
        /* 14479 */
        return this.playerPoints;
        /*       */
    }

    /*       */
    /*       */
    public void setPlayerPoints(int gain) {
        /* 14483 */
        this.playerPoints = gain;
        /*       */
    }

    /*       */
    /*       */
    public void gainPlayerPoints(int gain) {
        /* 14487 */
        if (this.playerPoints + gain < 0) {
            /*       */
            return;
            /*       */
        }
        /* 14490 */
        this.playerPoints += gain;
        /*       */
    }

    /*       */
    /*       */
    public int getPlayerEnergy() {
        /* 14494 */
        return this.playerEnergy;
        /*       */
    }

    /*       */
    /*       */
    public void setPlayerEnergy(int gain) {
        /* 14498 */
        this.playerEnergy = gain;
        /*       */
    }

    /*       */
    /*       */
    public void gainPlayerEnergy(int gain) {
        /* 14502 */
        if (this.playerEnergy + gain < 0) {
            /*       */
            return;
            /*       */
        }
        /* 14505 */
        this.playerEnergy += gain;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public MaplePvpStats getPvpStats() {
        /* 14512 */
        return this.pvpStats;
        /*       */
    }

    /*       */
    /*       */
    public int getPvpKills() {
        /* 14516 */
        return this.pvpKills;
        /*       */
    }

    /*       */
    /*       */
    public void gainPvpKill() {
        /* 14520 */
        this.pvpKills++;
        /* 14521 */
        this.pvpVictory++;
        /* 14522 */
        if (this.pvpVictory == 5) {
            /* 14523 */
            this.map.broadcastMessage(MaplePacketCreator.spouseMessage(10, "[Pvp] 玩家 " + getName() + " 已经达到 5 连斩。"));
            /* 14524 */
        } else if (this.pvpVictory == 10) {
            /* 14525 */
            this.client.getChannelServer().broadcastMessage(MaplePacketCreator.spouseMessage(10, "[Pvp] 玩家 " + getName() + " 已经达到 10 连斩。"));
            /* 14526 */
        } else if (this.pvpVictory >= 20) {
            /* 14527 */
            WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.spouseMessage(10, "[Pvp] 玩家 " + getName() + " 已经达到 " + this.pvpVictory + " 连斩。他(她)在频道 " + this.client.getChannel() + " 地图 " + this.map.getMapName() + " 中喊道谁能赐我一死."));
            /*       */
        } else {
            /* 14529 */
            dropMessage(6, "当前: " + this.pvpVictory + " 连斩.");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getPvpDeaths() {
        /* 14534 */
        return this.pvpDeaths;
        /*       */
    }

    /*       */
    /*       */
    public void gainPvpDeath() {
        /* 14538 */
        this.pvpDeaths++;
        /* 14539 */
        this.pvpVictory = 0;
        /*       */
    }

    /*       */
    /*       */
    public int getPvpVictory() {
        /* 14543 */
        return this.pvpVictory;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dropTopMsg(String message) {
        /* 14550 */
        this.client.announce(UIPacket.getTopMsg(message));
        /*       */
    }

    /*       */
    /*       */
    public void dropMidMsg(String message) {
        /* 14554 */
        this.client.announce(UIPacket.clearMidMsg());
        /* 14555 */
        this.client.announce(UIPacket.getMidMsg(message, true, 0));
        /*       */
    }

    /*       */
    /*       */
    public void clearMidMsg() {
        /* 14559 */
        this.client.announce(UIPacket.clearMidMsg());
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void dropSpecialTopMsg(String message, int fontsize, int color) {
        /* 14566 */
        dropSpecialTopMsg(message, 0, fontsize, color);
        /*       */
    }

    /*       */
    /*       */
    public void dropSpecialTopMsg(String message, int unk, int fontsize, int color) {
        /* 14570 */
        if (fontsize < 10) {
            /* 14571 */
            fontsize = 10;
            /*       */
        }
        /* 14573 */
        this.client.announce(UIPacket.getSpecialTopMsg(message, unk, fontsize, color));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getEventCount(String eventId) {
        /* 14581 */
        return getEventCount(eventId, 0);
        /*       */
    }

    /*       */
    /*       */
    public int getEventCount(String eventId, int type) {
        /* 14585 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 14586 */
            int count = 0;
            /* 14587 */
            PreparedStatement ps = con.prepareStatement("SELECT * FROM accounts_event WHERE accId = ? AND eventId = ?");
            /* 14588 */
            ps.setInt(1, getAccountID());
            /* 14589 */
            ps.setString(2, eventId);
            /* 14590 */
            ResultSet rs = ps.executeQuery();
            /* 14591 */
            if (rs.next()) {
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /*       */
                /* 14598 */
                count = rs.getInt("count");
                /* 14599 */
                Timestamp updateTime = rs.getTimestamp("updateTime");
                /* 14600 */
                if (type == 0) {
                    /* 14601 */
                    Calendar sqlcal = Calendar.getInstance();
                    /* 14602 */
                    if (updateTime != null) {
                        /* 14603 */
                        sqlcal.setTimeInMillis(updateTime.getTime());
                        /*       */
                    }
                    /* 14605 */
                    if (sqlcal.get(5) + 1 <= Calendar.getInstance().get(5) || sqlcal.get(2) + 1 <= Calendar.getInstance().get(2) || sqlcal.get(1) + 1 <= Calendar.getInstance().get(1)) {
                        /* 14606 */
                        count = 0;
                        /* 14607 */
                        PreparedStatement psu = con.prepareStatement("UPDATE accounts_event SET count = 0, updateTime = CURRENT_TIMESTAMP() WHERE accId = ? AND eventId = ?");
                        /* 14608 */
                        psu.setInt(1, getAccountID());
                        /* 14609 */
                        psu.setString(2, eventId);
                        /* 14610 */
                        psu.executeUpdate();
                        /* 14611 */
                        psu.close();
                        /*       */
                    }
                    /*       */
                }
                /*       */
            } else {
                /* 14615 */
                PreparedStatement psu = con.prepareStatement("INSERT INTO accounts_event (accId, eventId, count, type) VALUES (?, ?, ?, ?)");
                /* 14616 */
                psu.setInt(1, getAccountID());
                /* 14617 */
                psu.setString(2, eventId);
                /* 14618 */
                psu.setInt(3, 0);
                /* 14619 */
                psu.setInt(4, type);
                /* 14620 */
                psu.executeUpdate();
                /* 14621 */
                psu.close();
                /*       */
            }
            /* 14623 */
            rs.close();
            /* 14624 */
            ps.close();
            /* 14625 */
            return count;
            /* 14626 */
        } catch (Exception Ex) {
            /* 14627 */
            log.error("获取 EventCount 次数.", Ex);
            /* 14628 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setEventCount(String eventId) {
        /* 14636 */
        setEventCount(eventId, 0);
        /*       */
    }

    /*       */
    /*       */
    public void setEventCount(String eventId, int type) {
        /* 14640 */
        setEventCount(eventId, type, 1);
        /*       */
    }

    /*       */
    /*       */
    public void setEventCount(String eventId, int type, int count) {
        /* 14644 */
        int eventCount = getEventCount(eventId, type);
        /* 14645 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 14646 */
            PreparedStatement ps = con.prepareStatement("UPDATE accounts_event SET count = ?, type = ?, updateTime = CURRENT_TIMESTAMP() WHERE accId = ? AND eventId = ?");
            /* 14647 */
            ps.setInt(1, eventCount + count);
            /* 14648 */
            ps.setInt(2, type);
            /* 14649 */
            ps.setInt(3, getAccountID());
            /* 14650 */
            ps.setString(4, eventId);
            /* 14651 */
            ps.executeUpdate();
            /* 14652 */
            ps.close();
            /* 14653 */
        } catch (Exception Ex) {
            /* 14654 */
            log.error("增加 EventCount 次数失败.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void resetEventCount(String eventId) {
        /* 14662 */
        resetEventCount(eventId, 0);
        /*       */
    }

    /*       */
    /*       */
    public void resetEventCount(String eventId, int type) {
        /* 14666 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 14667 */
            PreparedStatement ps = con.prepareStatement("UPDATE accounts_event SET count = 0, type = ?, updateTime = CURRENT_TIMESTAMP() WHERE accId = ? AND eventId = ?");
            /* 14668 */
            ps.setInt(1, type);
            /* 14669 */
            ps.setInt(2, getAccountID());
            /* 14670 */
            ps.setString(3, eventId);
            /* 14671 */
            ps.executeUpdate();
            /* 14672 */
            ps.close();
            /* 14673 */
        } catch (Exception Ex) {
            /* 14674 */
            log.error("重置 EventCount 次数失败.", Ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkBeastTamerSkill() {
        /* 14683 */
        if (this.job != 11212 || this.level < 10) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 14687 */
        Map<Integer, SkillEntry> list = new HashMap<>();
        /*       */
        /* 14689 */
        int[] skillIds = {110001500, 110001501, 110001502, 110001506, 110001510, 110000800, 110001503, 110001504};
        /* 14690 */
        for (int i : skillIds) {
            /* 14691 */
            Skill skill = SkillFactory.getSkill(i);
            /* 14692 */
            if (skill != null && getSkillLevel(skill) <= 0) {
                /* 14693 */
                list.put(Integer.valueOf(i), new SkillEntry(1, (byte) 1, -1L));
                /*       */
            }
            /*       */
        }
        /*       */
        /* 14697 */
        Skill skil = SkillFactory.getSkill(110000515);
        /* 14698 */
        if (skil != null && this.level >= 30) {
            /* 14699 */
            int oldskilllevel = getSkillLevel(skil);
            /* 14700 */
            int newskilllevel = this.level / 10 - 2;
            /* 14701 */
            if (newskilllevel > skil.getMaxLevel()) {
                /* 14702 */
                newskilllevel = skil.getMaxLevel();
                /*       */
            }
            /* 14704 */
            if (newskilllevel > 0 && newskilllevel > oldskilllevel && oldskilllevel < skil.getMaxLevel()) {
                /* 14705 */
                list.put(Integer.valueOf(110000515), new SkillEntry((byte) newskilllevel, (byte) skil.getMaxLevel(), -1L));
                /*       */
            }
            /*       */
        }
        /*       */
        /* 14709 */
        if (this.level >= 120) {
            /* 14710 */
            skil = SkillFactory.getSkill(110001511);
            /* 14711 */
            if (skil != null && getSkillLevel(skil) <= 0) {
                /* 14712 */
                list.put(Integer.valueOf(110001511), new SkillEntry((byte) skil.getMaxLevel(), (byte) skil.getMaxLevel(), -1L));
                /*       */
            }
            /*       */
        }
        /*       */
        /* 14716 */
        if (this.level >= 150) {
            /* 14717 */
            skil = SkillFactory.getSkill(110001512);
            /* 14718 */
            if (skil != null && getSkillLevel(skil) <= 0) {
                /* 14719 */
                list.put(Integer.valueOf(110001512), new SkillEntry((byte) skil.getMaxLevel(), (byte) skil.getMaxLevel(), -1L));
                /*       */
            }
            /*       */
        }
        /*       */
        /* 14723 */
        if (!list.isEmpty()) {
            /* 14724 */
            changeSkillsLevel(list);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getBeastTamerSkillLevels(int skillId) {
        /* 14732 */
        int ret = 0;
        /* 14733 */
        int mod = skillId / 10000;
        /* 14734 */
        if (mod == 11200 || mod == 11210 || mod == 11211 || mod == 11212) {
            /* 14735 */
            Map<Integer, SkillEntry> chrSkills = new HashMap<>(getSkills());
            /* 14736 */
            for (Map.Entry<Integer, SkillEntry> list : chrSkills.entrySet()) {
                /* 14737 */
                Skill skill = SkillFactory.getSkill(((Integer) list.getKey()).intValue());
                /* 14738 */
                if (((Integer) list.getKey()).intValue() / 10000 == mod && !skill.isLinkedAttackSkill()) {
                    /* 14739 */
                    ret += getSkillLevel(((Integer) list.getKey()).intValue());
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 14743 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainBeastTamerSkillExp(int amount) {
        /* 14752 */
        if (this.job != 11212 || this.level < 60 || amount < 0) {
            /*       */
            return;
            /*       */
        }
        /* 14755 */
        Skill skil = SkillFactory.getSkill(110000513);
        /* 14756 */
        if (skil == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 14760 */
        MapleQuestStatus levelStat = getQuestNAdd(MapleQuest.getInstance(59340));
        /* 14761 */
        if (levelStat.getCustomData() == null) {
            /* 14762 */
            levelStat.setCustomData("1");
            /*       */
        }
        /* 14764 */
        if (levelStat.getStatus() != 1) {
            /* 14765 */
            levelStat.setStatus((byte) 1);
            /*       */
        }
        /*       */
        /* 14768 */
        MapleQuestStatus expStat = getQuestNAdd(MapleQuest.getInstance(59341));
        /* 14769 */
        if (expStat.getCustomData() == null) {
            /* 14770 */
            expStat.setCustomData("0");
            /*       */
        }
        /* 14772 */
        if (expStat.getStatus() != 1) {
            /* 14773 */
            expStat.setStatus((byte) 1);
            /*       */
        }
        /* 14775 */
        int skillLevel = Integer.parseInt(levelStat.getCustomData());
        /*       */
        /* 14777 */
        if (getSkillLevel(skil) <= skillLevel) {
            /* 14778 */
            Map<Integer, SkillEntry> sDate = new HashMap<>();
            /* 14779 */
            sDate.put(Integer.valueOf(skil.getId()), new SkillEntry((byte) skillLevel, (byte) skil.getMaxLevel(), -1L));
            /* 14780 */
            changeSkillLevel_Skip(sDate, false);
            /* 14781 */
            updateQuest(levelStat, true);
            /* 14782 */
            updateQuest(expStat, true);
            /* 14783 */
            this.changed_skills = true;
            /*       */
            return;
            /*       */
        }
        /* 14786 */
        int skillExp = Integer.parseInt(expStat.getCustomData());
        /* 14787 */
        int needed = skil.getBonusExpInfo(skillLevel);
        /* 14788 */
        int newExp = skillExp + amount;
        /* 14789 */
        if (newExp >= needed) {
            /* 14790 */
            if (skillLevel < skil.getMaxLevel()) {
                /* 14791 */
                int newLevel = skillLevel + 1;
                /* 14792 */
                if (newLevel > skil.getMaxLevel()) {
                    /* 14793 */
                    newLevel = skil.getMaxLevel();
                    /*       */
                }
                /* 14795 */
                Map<Integer, SkillEntry> sDate = new HashMap<>();
                /* 14796 */
                sDate.put(Integer.valueOf(skil.getId()), new SkillEntry((byte) newLevel, (byte) skil.getMaxLevel(), -1L));
                /* 14797 */
                changeSkillLevel_Skip(sDate, false);
                /* 14798 */
                levelStat.setCustomData(String.valueOf(newLevel));
                /* 14799 */
                expStat.setCustomData("0");
                /* 14800 */
                this.changed_skills = true;
                /*       */
            } else {
                /* 14802 */
                levelStat.setCustomData("30");
                /* 14803 */
                expStat.setCustomData("10000");
                /*       */
            }
            /*       */
        } else {
            /* 14806 */
            expStat.setCustomData(String.valueOf(newExp));
            /*       */
        }
        /* 14808 */
        updateQuest(levelStat, true);
        /* 14809 */
        updateQuest(expStat, true);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void fixTeachSkillLevel() {
        /* 14816 */
        int skillId = JobConstants.getTecahSkillID(getJob());
        /*       */
        /* 14818 */
        if (skillId <= 0) {
            /*       */
            return;
            /*       */
        }
        /* 14821 */
        Skill skill = SkillFactory.getSkill(skillId);
        /*       */
        /* 14823 */
        if (skill == null || skill.getMaxLevel() <= 1) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 14827 */
        if (skill.canBeLearnedBy(getJob())) {
            /*       */
            /* 14829 */
            int oldlevel = getSkillLevel(skill);
            /*       */
            /* 14831 */
            int newlevel = (this.level >= 210) ? 3 : ((this.level >= 120) ? 2 : 1);
            /*       */
            /* 14833 */
            int maxlevel = skill.getMaxLevel();
            /*       */
            /* 14835 */
            if (newlevel > maxlevel) {
                /* 14836 */
                newlevel = maxlevel;
                /*       */
            }
            /*       */
            /* 14839 */
            if (newlevel != oldlevel) {
                /* 14840 */
                Map<Integer, SkillEntry> sDate = new HashMap<>();
                /* 14841 */
                SkillEntry ret = getSkillEntry(skillId);
                /* 14842 */
                if (ret != null) {
                    /* 14843 */
                    ret.skillevel = newlevel;
                    /* 14844 */
                    ret.masterlevel = (byte) skill.getMaxLevel();
                    /* 14845 */
                    sDate.put(Integer.valueOf(skillId), ret);
                    /*       */
                } else {
                    /* 14847 */
                    sDate.put(Integer.valueOf(skillId), new SkillEntry((byte) newlevel, (byte) skill.getMaxLevel(), -1L));
                    /*       */
                }
                /* 14849 */
                changeSkillsLevel(sDate);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean isSamePartyId(int partyId) {
        /* 14855 */
        return (partyId > 0 && this.party != null && this.party.getPartyId() == partyId);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public long getTotDamageToMob() {
        /* 14862 */
        return this.totDamageToMob;
        /*       */
    }

    /*       */
    /*       */
    public void setTotDamageToMob(long totDamageToMob) {
        /* 14866 */
        this.totDamageToMob = totDamageToMob;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void prepareFuWenTime(long time) {
        /* 14873 */
        this.lastFuWenTime = System.currentTimeMillis() + time;
        /*       */
    }

    /*       */
    /*       */
    public int getLastFuWenTime() {
        /* 14877 */
        if (this.lastFuWenTime <= 0L) {
            /* 14878 */
            this.lastFuWenTime = System.currentTimeMillis();
            /*       */
        }
        /* 14880 */
        long time = this.lastFuWenTime - System.currentTimeMillis();
        /* 14881 */
        if (time <= 0L) {
            /* 14882 */
            return 0;
            /*       */
        }
        /* 14884 */
        return (int) time;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<Integer, Integer> getSkillSkin() {
        /* 14891 */
        Map<Integer, Integer> ret = new LinkedHashMap<>();
        /* 14892 */
        List<Integer> theList = getInventory(MapleInventoryType.EQUIPPED).listSkillSkinIds();
        /* 14893 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /* 14894 */
        for (Integer i : theList) {
            /* 14895 */
            int skillId = ii.getSkillSkinFormSkillId(i.intValue());
            /* 14896 */
            Skill skill = SkillFactory.getSkill(skillId);
            /* 14897 */
            if (skill != null) {
                /* 14898 */
                ret.put(Integer.valueOf(skillId), i);
                /*       */
            }
            /*       */
        }
        /* 14901 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public ModifyItemPotential getItemPotential() {
        /* 14908 */
        return this.ItemPotential;
        /*       */
    }

    /*       */
    /*       */
    public void setItemPotential(ModifyItemPotential potential) {
        /* 14912 */
        this.ItemPotential = potential;
        /*       */
    }

    /*       */
    /*       */
    public void resetItemPotential() {
        /* 14916 */
        this.ItemPotential = null;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void instantMapWarp(int portalId) {
        /* 14923 */
        if (this.map == null) {
            /*       */
            return;
            /*       */
        }
        /* 14926 */
        MaplePortal portal = this.map.getPortal(portalId);
        /* 14927 */
        if (portal == null) {
            /* 14928 */
            portal = this.map.getPortal(0);
            /*       */
        }
        /* 14930 */
        Point portalPos = new Point(portal.getPosition());
        /* 14931 */
        this.client.announce(MaplePacketCreator.instantMapWarp(getId(), portalPos));
        /* 14932 */
        checkFollow();
        /* 14933 */
        this.map.movePlayer(this, portalPos);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void instantMapWarp(Point portalPos) {
        /* 14940 */
        if (this.map == null || portalPos == null) {
            /*       */
            return;
            /*       */
        }
        /* 14943 */
        this.client.announce(MaplePacketCreator.instantMapWarp(getId(), portalPos));
        /* 14944 */
        checkFollow();
        /* 14945 */
        this.map.movePlayer(this, portalPos);
        /*       */
    }

    /*       */
    /*       */
    public final int[] StringtoInt(String str) {
        /* 14949 */
        int[] ret = new int[100];
        /* 14950 */
        StringTokenizer toKenizer = new StringTokenizer(str, ",");
        /* 14951 */
        String[] strx = new String[toKenizer.countTokens()];
        /* 14952 */
        for (int i = 0; i < toKenizer.countTokens(); i++) {
            /* 14953 */
            strx[i] = toKenizer.nextToken();
            /* 14954 */
            ret[i] = Integer.valueOf(strx[i]).intValue();
            /*       */
        }
        /* 14956 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final boolean MissionCanMake(int missionid) {
        /* 14961 */
        boolean ret = true;
        /* 14962 */
        for (int i = 1; i < 5; i++) {
            /* 14963 */
            if (!MissionCanMake(missionid, i)) {
                /* 14964 */
                ret = false;
                /*       */
            }
            /*       */
        }
        /* 14967 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public final boolean MissionCanMake(int missionid, int checktype) {
        /* 14977 */
        boolean ret = false;
        /* 14978 */
        int minlevel = -1, maxlevel = -1;
        /* 14979 */
        String joblist = "all", itemlist = "none", prelist = "none";
        /* 14980 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 14981 */         PreparedStatement ps = con.prepareStatement("SELECT minlevel,maxlevel,joblist,itemlist,prelist FROM missionlist WHERE missionid = ?")) {
            /* 14982 */
            ps.setInt(1, missionid);
            /* 14983 */
            try (ResultSet rs = ps.executeQuery()) {
                /* 14984 */
                if (rs.next()) {
                    /* 14985 */
                    minlevel = rs.getInt("minlevel");
                    /* 14986 */
                    maxlevel = rs.getInt("maxlevel");
                    /* 14987 */
                    joblist = rs.getString("joblist");
                    /* 14988 */
                    itemlist = rs.getString("itemlist");
                    /* 14989 */
                    prelist = rs.getString("prelist");
                    /*       */
                }
                /*       */
                /*       */
            }
            /* 14993 */
        } catch (SQLException ex) {
            /* 14994 */
            log.error("Error MissionCanMake:", ex);
            /*       */
        }
        /*       */
        /* 14997 */
        switch (checktype) {
            /*       */
            case 1:
                /* 14999 */
                if (minlevel > -1 && maxlevel > -1) {
                    /* 15000 */
                    if (getLevel() >= minlevel && getLevel() <= maxlevel)
                        /* 15001 */ ret = true;
                    break;
                    /*       */
                }
                /* 15003 */
                if (minlevel > -1 && maxlevel == -1) {
                    /* 15004 */
                    if (getLevel() >= minlevel)
                        /* 15005 */ ret = true;
                    break;
                    /*       */
                }
                /* 15007 */
                if (minlevel == -1 && maxlevel > -1) {
                    /* 15008 */
                    if (getLevel() <= maxlevel)
                        /* 15009 */ ret = true;
                    break;
                    /*       */
                }
                /* 15011 */
                if (minlevel == -1 && maxlevel == -1) {
                    /* 15012 */
                    ret = true;
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 2:
                /* 15016 */
                if (joblist.equals("all")) {
                    /* 15017 */
                    ret = true;
                    break;
                    /*       */
                }
                /* 15019 */
                for (int i : StringtoInt(joblist)) {
                    /* 15020 */
                    if (getJob() == i) {
                        /* 15021 */
                        ret = true;
                        /*       */
                        break;
                        /*       */
                    }
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            case 3:
                /* 15028 */
                if (itemlist.equals("none")) {
                    /* 15029 */
                    ret = true;
                    break;
                    /*       */
                }
                /* 15031 */
                for (int i : StringtoInt(itemlist)) {
                    /* 15032 */
                    if (!haveItem(i)) {
                        /* 15033 */
                        ret = false;
                        /*       */
                        break;
                        /*       */
                    }
                    /*       */
                }
                /*       */
                break;
            /*       */
            /*       */
            case 4:
                /* 15040 */
                if (prelist.equals("none")) {
                    /* 15041 */
                    ret = true;
                    break;
                    /*       */
                }
                /* 15043 */
                for (int i : StringtoInt(prelist)) {
                    /* 15044 */
                    if (!MissionStatus(getId(), i, 0, 1)) {
                        /* 15045 */
                        ret = false;
                        /*       */
                        break;
                        /*       */
                    }
                    /*       */
                }
                /*       */
                break;
            /*       */
        }
        /*       */
        /* 15052 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public final int MissionGetIntData(int missionid, int checktype) {
        /* 15060 */
        int ret = -1;
        /* 15061 */
        int minlevel = -1, maxlevel = -1;
        /* 15062 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 15063 */
            try (PreparedStatement ps = con.prepareStatement("SELECT minlevel,maxlevel FROM missionlist WHERE missionid = ?")) {
                /* 15064 */
                ps.setInt(1, missionid);
                /* 15065 */
                try (ResultSet rs = ps.executeQuery()) {
                    /* 15066 */
                    if (rs.next()) {
                        /* 15067 */
                        minlevel = rs.getInt("minlevel");
                        /* 15068 */
                        maxlevel = rs.getInt("maxlevel");
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
            /* 15073 */
            switch (checktype) {
                /*       */
                case 1:
                    /* 15075 */
                    ret = minlevel;
                    /*       */
                    break;
                /*       */
                case 2:
                    /* 15078 */
                    ret = maxlevel;
                    /*       */
                    break;
                /*       */
            }
            /* 15081 */
        } catch (SQLException ex) {
            /* 15082 */
            log.error("Error MissionGetIntData:", ex);
            /*       */
        }
        /* 15084 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public final String MissionGetStrData(int missionid, int checktype) {
        /* 15094 */
        String ret = "";
        /* 15095 */
        String missionname = "", joblist = "all", itemlist = "none", prelist = "none";
        /* 15096 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 15097 */
            try (PreparedStatement ps = con.prepareStatement("SELECT missionname,joblist,itemlist,prelist FROM missionlist WHERE missionid = ?")) {
                /* 15098 */
                ps.setInt(1, missionid);
                /* 15099 */
                try (ResultSet rs = ps.executeQuery()) {
                    /* 15100 */
                    if (rs.next()) {
                        /* 15101 */
                        missionname = rs.getString("missionname");
                        /* 15102 */
                        joblist = rs.getString("joblist");
                        /* 15103 */
                        itemlist = rs.getString("itemlist");
                        /* 15104 */
                        prelist = rs.getString("prelist");
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
            /* 15109 */
            switch (checktype) {
                /*       */
                case 1:
                    /* 15111 */
                    ret = missionname;
                    /*       */
                    break;
                /*       */
                case 2:
                    /* 15114 */
                    ret = joblist;
                    /*       */
                    break;
                /*       */
                case 3:
                    /* 15117 */
                    ret = itemlist;
                    /*       */
                    break;
                /*       */
                case 4:
                    /* 15120 */
                    ret = prelist;
                    /*       */
                    break;
                /*       */
            }
            /* 15123 */
        } catch (SQLException ex) {
            /* 15124 */
            log.error("Error MissionCanMake:", ex);
            /*       */
        }
        /* 15126 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final String MissionGetJoblist(String joblist) {
        /* 15131 */
        StringBuilder ret = new StringBuilder();
        /* 15132 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 15133 */
            for (int i : StringtoInt(joblist)) {
                /* 15134 */
                try (PreparedStatement ps = con.prepareStatement("SELECT * FROM joblist WHERE id = ?")) {
                    /* 15135 */
                    ps.setInt(1, i);
                    /*       */
                    /* 15137 */
                    try (ResultSet rs = ps.executeQuery()) {
                        /* 15138 */
                        if (rs.next()) {
                            /* 15139 */
                            ret.append(",").append(rs.getString("jobname"));
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /* 15144 */
        } catch (SQLException ex) {
            /* 15145 */
            log.error("Error MissionGetJoblist:", ex);
            /*       */
        }
        /* 15147 */
        return ret.toString();
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionMake(int charid, int missionid, int repeat, long repeattime, int lockmap, int mobid) {
        /* 15152 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15153 */         PreparedStatement ps = con.prepareStatement("INSERT INTO missionstatus VALUES (DEFAULT, ?, ?, ?, ?, ?, 0, DEFAULT, 0, 0, ?, 0, 0)")) {
            /* 15154 */
            ps.setInt(1, missionid);
            /* 15155 */
            ps.setInt(2, charid);
            /* 15156 */
            ps.setInt(3, repeat);
            /* 15157 */
            ps.setLong(4, repeattime);
            /* 15158 */
            ps.setInt(5, lockmap);
            /* 15159 */
            ps.setInt(6, mobid);
            /* 15160 */
            ps.executeUpdate();
            /*       */
        }
        /* 15162 */ catch (SQLException ex) {
            /* 15163 */
            log.error("Error MissionMake:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionReMake(int charid, int missionid, int repeat, long repeattime, int lockmap) {
        /* 15169 */
        int finish = 0;
        /* 15170 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15171 */         PreparedStatement ps = con.prepareStatement("UPDATE missionstatus SET `repeat` = ?, repeattime = ?, lockmap = ?, finish = ?, minnum = 0 WHERE missionid = ? AND charid = ?")) {
            /* 15172 */
            ps.setInt(1, repeat);
            /* 15173 */
            ps.setLong(2, repeattime);
            /* 15174 */
            ps.setInt(3, lockmap);
            /* 15175 */
            ps.setInt(4, finish);
            /* 15176 */
            ps.setInt(5, missionid);
            /* 15177 */
            ps.setInt(6, charid);
            /* 15178 */
            ps.executeUpdate();
            /*       */
        }
        /* 15180 */ catch (SQLException ex) {
            /* 15181 */
            log.error("Error MissionFinish:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionFinish(int charid, int missionid) {
        /* 15187 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15188 */         PreparedStatement ps = con.prepareStatement("UPDATE missionstatus SET finish = 1, lastdate = CURRENT_TIMESTAMP(), times = times+1, lockmap = 0 WHERE missionid = ? AND charid = ?")) {
            /* 15189 */
            ps.setInt(1, missionid);
            /* 15190 */
            ps.setInt(2, charid);
            /* 15191 */
            ps.executeUpdate();
            /*       */
        }
        /* 15193 */ catch (SQLException sQLException) {
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public final int MissionGetFinish(int charid, int missionid) {
        /* 15200 */
        int ret = 0;
        /* 15201 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15202 */         PreparedStatement ps = con.prepareStatement("SELECT times FROM missionstatus WHERE missionid = ? AND charid = ?")) {
            /* 15203 */
            ps.setInt(1, missionid);
            /* 15204 */
            ps.setInt(2, charid);
            /* 15205 */
            try (ResultSet rs = ps.executeQuery()) {
                /* 15206 */
                if (rs.next()) {
                    /* 15207 */
                    ret = rs.getInt(1);
                    /*       */
                }
                /*       */
            }
            /*       */
            /* 15211 */
        } catch (SQLException ex) {
            /* 15212 */
            log.error("Error MissionFinish:", ex);
            /*       */
        }
        /* 15214 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionDelete(int charid, int missionid) {
        /* 15219 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15220 */         PreparedStatement ps = con.prepareStatement("DELETE FROM missionstatus WHERE missionid = ? AND charid = ?")) {
            /* 15221 */
            ps.setInt(1, missionid);
            /* 15222 */
            ps.setInt(2, charid);
            /* 15223 */
            ps.executeUpdate();
            /*       */
        }
        /* 15225 */ catch (SQLException ex) {
            /* 15226 */
            log.error("Error MissionDelete:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionSetMinNum(int charid, int missionid, int num) {
        /* 15232 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15233 */         PreparedStatement ps = con.prepareStatement("UPDATE missionstatus SET `minnum` = ? WHERE missionid = ? AND charid = ?")) {
            /* 15234 */
            ps.setInt(1, num);
            /* 15235 */
            ps.setInt(2, missionid);
            /* 15236 */
            ps.setInt(3, charid);
            /* 15237 */
            ps.executeUpdate();
            /*       */
        }
        /* 15239 */ catch (SQLException ex) {
            /* 15240 */
            log.error("Error MissionAddNum:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionAddMinNum(int charid, int missionid, int num) {
        /* 15246 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15247 */         PreparedStatement ps = con.prepareStatement("UPDATE missionstatus SET `minnum` = `minnum` + ? WHERE missionid = ? AND charid = ?")) {
            /* 15248 */
            ps.setInt(1, num);
            /* 15249 */
            ps.setInt(2, missionid);
            /* 15250 */
            ps.setInt(3, charid);
            /* 15251 */
            ps.executeUpdate();
            /*       */
        }
        /* 15253 */ catch (SQLException ex) {
            /* 15254 */
            log.error("Error MissionAddNum:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final int MissionGetMinNum(int charid, int missionid, int mobid) {
        /* 15260 */
        int ret = 0;
        /* 15261 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*       */
            String sql;
            /* 15263 */
            if (mobid == 0) {
                /* 15264 */
                sql = "SELECT minnum FROM missionstatus WHERE charid = ? AND missionid = ?";
                /*       */
            } else {
                /* 15266 */
                sql = "SELECT minnum FROM missionstatus WHERE charid = ? AND missionid = ? AND mobid = ?";
                /*       */
            }
            /* 15268 */
            try (PreparedStatement ps = con.prepareStatement(sql)) {
                /* 15269 */
                if (mobid == 0) {
                    /* 15270 */
                    ps.setInt(1, charid);
                    /* 15271 */
                    ps.setInt(2, missionid);
                    /*       */
                } else {
                    /* 15273 */
                    ps.setInt(1, charid);
                    /* 15274 */
                    ps.setInt(2, missionid);
                    /* 15275 */
                    ps.setInt(3, mobid);
                    /*       */
                }
                /* 15277 */
                try (ResultSet rs = ps.executeQuery()) {
                    /* 15278 */
                    if (rs.next()) {
                        /* 15279 */
                        ret = rs.getInt("minnum");
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*       */
            }
            /* 15284 */
        } catch (SQLException ex) {
            /* 15285 */
            log.error("Error MissionMob:", ex);
            /*       */
        }
        /* 15287 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final int MissionGetMaxNum(int charid, int missionid, int mobid) {
        /* 15292 */
        int ret = 0;
        /* 15293 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*       */
            String sql;
            /* 15295 */
            if (mobid == 0) {
                /* 15296 */
                sql = "SELECT maxnum FROM missionstatus WHERE charid = ? AND missionid = ?";
                /*       */
            } else {
                /* 15298 */
                sql = "SELECT maxnum FROM missionstatus WHERE charid = ? AND missionid = ? AND mobid = ?";
                /*       */
            }
            /* 15300 */
            try (PreparedStatement ps = con.prepareStatement(sql)) {
                /* 15301 */
                if (mobid == 0) {
                    /* 15302 */
                    ps.setInt(1, charid);
                    /* 15303 */
                    ps.setInt(2, missionid);
                    /*       */
                } else {
                    /* 15305 */
                    ps.setInt(1, charid);
                    /* 15306 */
                    ps.setInt(2, missionid);
                    /* 15307 */
                    ps.setInt(3, mobid);
                    /*       */
                }
                /* 15309 */
                try (ResultSet rs = ps.executeQuery()) {
                    /* 15310 */
                    if (rs.next()) {
                        /* 15311 */
                        ret = rs.getInt("maxnum");
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /*       */
            }
            /* 15316 */
        } catch (SQLException ex) {
            /* 15317 */
            log.error("Error MissionMob:", ex);
            /*       */
        }
        /* 15319 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final int MissionGetMobId(int charid, int missionid) {
        /* 15324 */
        int ret = 0;
        /* 15325 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15326 */         PreparedStatement ps = con.prepareStatement("SELECT mobid FROM missionstatus WHERE charid = ? AND missionid = ?")) {
            /* 15327 */
            ps.setInt(1, charid);
            /* 15328 */
            ps.setInt(2, missionid);
            /* 15329 */
            try (ResultSet rs = ps.executeQuery()) {
                /* 15330 */
                if (rs.next()) {
                    /* 15331 */
                    ret = rs.getInt("mobid");
                    /*       */
                }
                /*       */
            }
            /*       */
            /*       */
        }
        /* 15336 */ catch (SQLException ex) {
            /* 15337 */
            log.error("Error MissionMob:", ex);
            /*       */
        }
        /* 15339 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionSetMobId(int charid, int missionid, int mobid) {
        /* 15344 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15345 */         PreparedStatement ps = con.prepareStatement("UPDATE missionstatus SET `mobid` = ? WHERE missionid = ? AND charid = ?")) {
            /* 15346 */
            ps.setInt(1, mobid);
            /* 15347 */
            ps.setInt(2, missionid);
            /* 15348 */
            ps.setInt(3, charid);
            /* 15349 */
            ps.executeUpdate();
            /*       */
        }
        /* 15351 */ catch (SQLException ex) {
            /* 15352 */
            log.error("Error MissionAddNum:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionMaxNum(int missionid, int maxnum) {
        /* 15358 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15359 */         PreparedStatement ps = con.prepareStatement("UPDATE missionstatus SET `maxnum` = ? WHERE missionid = ? AND charid = ?")) {
            /* 15360 */
            ps.setInt(1, maxnum);
            /* 15361 */
            ps.setInt(2, missionid);
            /* 15362 */
            ps.setInt(3, getId());
            /* 15363 */
            ps.executeUpdate();
            /*       */
        }
        /* 15365 */ catch (SQLException ex) {
            /* 15366 */
            log.error("Error MissionMaxNum:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final long MissionGetRepeattime(int charid, int missionid) {
        /* 15372 */
        long ret = 0L;
        /* 15373 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15374 */         PreparedStatement ps = con.prepareStatement("SELECT repeattime FROM missionstatus WHERE charid = ? AND missionid = ?")) {
            /* 15375 */
            ps.setInt(1, charid);
            /* 15376 */
            ps.setInt(2, missionid);
            /* 15377 */
            try (ResultSet rs = ps.executeQuery()) {
                /* 15378 */
                if (rs.next()) {
                    /* 15379 */
                    ret = rs.getLong("repeattime");
                    /*       */
                }
                /*       */
            }
            /*       */
            /*       */
        }
        /* 15384 */ catch (SQLException ex) {
            /* 15385 */
            log.error("Error MissionMob:", ex);
            /*       */
        }
        /* 15387 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final void MissionDeleteNotFinish(int charid) {
        /* 15392 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 15393 */         PreparedStatement ps = con.prepareStatement("DELETE FROM missionstatus WHERE finish = 0 AND charid = ?")) {
            /*       */
            /* 15395 */
            ps.setInt(1, charid);
            /* 15396 */
            ps.executeUpdate();
            /*       */
        }
        /* 15398 */ catch (SQLException ex) {
            /* 15399 */
            log.error("Error MissionDeleteNotFinish:", ex);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public final boolean MissionStatus(int charid, int missionid, int maxtimes, int checktype) {
        /* 15413 */
        boolean ret = false;
        /* 15414 */
        int MissionMake = 0;
        /* 15415 */
        long now = 0L;
        /* 15416 */
        long t = 0L;
        /*       */
        /* 15418 */
        int repeat = 0;
        /* 15419 */
        int repeattime = 0;
        /* 15420 */
        int finish = 0;
        /* 15421 */
        int times = 0;
        /* 15422 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /*       */
            String sql;
            /* 15424 */
            if (checktype == 5) {
                /* 15425 */
                sql = "SELECT * FROM missionstatus WHERE lockmap = 1 AND charid = ?";
                /*       */
            } else {
                /* 15427 */
                sql = "SELECT * FROM missionstatus WHERE missionid = ? AND charid = ?";
                /*       */
            }
            /* 15429 */
            try (PreparedStatement ps = con.prepareStatement(sql)) {
                /* 15430 */
                if (checktype == 5) {
                    /* 15431 */
                    ps.setInt(1, charid);
                    /*       */
                } else {
                    /* 15433 */
                    ps.setInt(1, missionid);
                    /* 15434 */
                    ps.setInt(2, charid);
                    /*       */
                }
                /* 15436 */
                try (ResultSet rs = ps.executeQuery()) {
                    /* 15437 */
                    if (rs.next()) {
                        /* 15438 */
                        Timestamp lastdate = rs.getTimestamp("lastdate");
                        /* 15439 */
                        repeat = rs.getInt("repeat");
                        /* 15440 */
                        repeattime = rs.getInt("repeattime");
                        /* 15441 */
                        finish = rs.getInt("finish");
                        /* 15442 */
                        times = rs.getInt("times");
                        /* 15443 */
                        t = lastdate.getTime();
                        /* 15444 */
                        now = System.currentTimeMillis();
                        /* 15445 */
                        MissionMake = 1;
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /* 15449 */
        } catch (SQLException ex) {
            /* 15450 */
            log.error("Error MissionStatus:", ex);
            /*       */
        }
        /*       */
        /* 15453 */
        switch (checktype) {
            /*       */
            case 0:
                /* 15455 */
                if (finish == 1) {
                    /* 15456 */
                    ret = true;
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 1:
                /* 15460 */
                if (repeat == 1) {
                    /* 15461 */
                    ret = true;
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 2:
                /* 15465 */
                if (now - t > repeattime)
                    /*       */ {
                    /* 15467 */
                    ret = true;
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 3:
                /* 15471 */
                if (times >= maxtimes)
                    /*       */ {
                    /* 15473 */
                    ret = true;
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 4:
                /* 15477 */
                if (MissionMake == 1)
                    /*       */ {
                    /* 15479 */
                    ret = true;
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 5:
                /* 15483 */
                if (MissionMake == 1)
                    /*       */ {
                    /* 15485 */
                    ret = true;
                }
                /*       */
                break;
            /*       */
        }
        /* 15488 */
        return ret;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void renewInnerSkills(int itemId) {
        /* 15497 */
        renewInnerSkills(itemId, new ArrayList<>());
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void renewInnerSkills(int itemId, List<Integer> lockPosition) {
        /* 15507 */
        int LVProp, dropProp, lines = (getLevel() >= 50) ? 3 : 0;
        /*       */
        /* 15509 */
        if (lines < getInnerSkillSize()) {
            /* 15510 */
            lines = (getInnerSkillSize() > 3) ? 3 : getInnerSkillSize();
            /*       */
        }
        /*       */
        /*       */
        /* 15514 */
        int maxRank = 3;
        /*       */
        /*       */
        /* 15517 */
        if (itemId == 2702000 || itemId == 2702001) {
            /* 15518 */
            maxRank = 2;
            /*       */
        }
        /*       */
        /*       */
        /* 15522 */
        int innerRank = getInnerRank();
        /*       */
        /*       */
        /*       */
        /* 15526 */
        switch (innerRank) {
            /*       */
            case 0:
                /* 15528 */
                LVProp = isAdmin() ? 999 : 300;
                /* 15529 */
                dropProp = 0;
                /*       */
                break;
            /*       */
            case 1:
                /* 15532 */
                LVProp = isAdmin() ? 999 : 100;
                /* 15533 */
                dropProp = isAdmin() ? 0 : 50;
                /*       */
                break;
            /*       */
            case 2:
                /* 15536 */
                LVProp = isAdmin() ? 999 : 50;
                /* 15537 */
                dropProp = isAdmin() ? 0 : 500;
                /*       */
                break;
            /*       */
            case 3:
                /* 15540 */
                LVProp = isAdmin() ? 999 : 20;
                /* 15541 */
                dropProp = isAdmin() ? 0 : 700;
                /*       */
                break;
            /*       */
            default:
                /* 15544 */
                LVProp = 0;
                /* 15545 */
                dropProp = 0;
                /*       */
                break;
            /*       */
        }
        /*       */
        /* 15549 */
        if (LVProp > Randomizer.nextInt(1000) && innerRank < maxRank && itemId > -2) {
            /* 15550 */
            innerRank++;
            /*       */
        }
        /*       */
        /* 15553 */
        if (dropProp > Randomizer.nextInt(1000) && innerRank > 0 && itemId > -1 && itemId != 5062800 && itemId != 5062801) {
            /* 15554 */
            innerRank--;
            /*       */
        }
        /*       */
        /*       */
        /*       */
        /* 15559 */
        for (int i = 0; i < lines; i++) {
            /* 15560 */
            InnerSkillEntry newskill = null;
            /*       */
            /* 15562 */
            if (!lockPosition.contains(Integer.valueOf(i + 1)))
                /*       */ {
                /*       */
                /* 15565 */
                while (newskill == null) {
                    /* 15566 */
                    newskill = InnerAbillity.getInstance().renewSkill(innerRank, i + 1);
                    /* 15567 */
                    if (newskill != null) {
                        /* 15568 */
                        for (InnerSkillEntry InnerSkill : getInnerSkills()) {
                            /* 15569 */
                            if (InnerSkill != null && InnerSkill.getSkillId() == newskill.getSkillId()) {
                                /* 15570 */
                                newskill = null;
                                /*       */
                                break;
                                /*       */
                            }
                            /*       */
                        }
                        /*       */
                    }
                    /* 15575 */
                    if (newskill != null) {
                        /* 15576 */
                        changeInnerSkill(newskill);
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    public int getInnerRank() {
        /* 15586 */
        int innerRank = 0;
        /* 15587 */
        for (InnerSkillEntry innerSkill : this.innerSkills) {
            /* 15588 */
            if (innerSkill != null)
                /*       */ {
                /*       */
                /* 15591 */
                if (innerSkill.getRank() > innerRank)
                    /* 15592 */ innerRank = innerSkill.getRank();
                /*       */
            }
            /*       */
        }
        /* 15595 */
        return innerRank;
        /*       */
    }

    /*       */
    /*       */
    public InnerSkillEntry renewSkill(int rank, int position) {
        /* 15599 */
        int skillLevel, randomSkill = ItemConstants.getInnerSkillbyRank(rank)[(int) Math.floor(Math.random() * (ItemConstants.getInnerSkillbyRank(rank)).length)];
        /* 15600 */
        Skill skill = SkillFactory.getSkill(randomSkill);
        /* 15601 */
        if (skill == null) {
            /* 15602 */
            return null;
            /*       */
        }
        /*       */
        /* 15605 */
        int firstmin = skill.getMaxLevel() / 2;
        /* 15606 */
        int firstmax = skill.getMaxLevel();
        /* 15607 */
        int Othermax = skill.getMaxLevel() / 2;
        /* 15608 */
        switch (skill.getMaxLevel()) {
            /*       */
            /*       */
            case 40:
                /* 15611 */
                firstmin = (rank == 0) ? 1 : ((rank == 1) ? 11 : ((rank == 2) ? 21 : 31));
                /*       */
                /* 15613 */
                firstmax = (rank == 0) ? 10 : ((rank == 1) ? 20 : ((rank == 2) ? 30 : 40));
                /*       */
                /* 15615 */
                Othermax = (rank == 0) ? 10 : ((rank == 1) ? 10 : ((rank == 2) ? 20 : 30));
                /*       */
                break;
            /*       */
            /*       */
            case 30:
                /* 15619 */
                firstmin = (rank == 0 || rank == 1) ? 1 : ((rank == 2) ? 11 : 21);
                /*       */
                /* 15621 */
                firstmax = (rank == 0) ? 1 : ((rank == 1) ? 10 : ((rank == 2) ? 20 : 30));
                /*       */
                /* 15623 */
                Othermax = (rank == 0 || rank == 1) ? 1 : ((rank == 2) ? 10 : 20);
                /*       */
                break;
            /*       */
            /*       */
            case 20:
                /* 15627 */
                firstmin = (rank == 0 || rank == 1 || rank == 2) ? 1 : 11;
                /*       */
                /* 15629 */
                firstmax = (rank == 0 || rank == 1) ? 1 : ((rank == 2) ? 10 : 20);
                /*       */
                /* 15631 */
                Othermax = (rank == 0 || rank == 1 || rank == 2) ? 1 : 10;
                /*       */
                break;
            /*       */
            /*       */
            case 10:
                /* 15635 */
                firstmin = 1;
                /*       */
                /* 15637 */
                firstmax = (rank == 0 || rank == 1 || rank == 2) ? 1 : 10;
                /*       */
                /* 15639 */
                Othermax = 1;
                /*       */
                break;
            /*       */
        }
        /*       */
        /* 15643 */
        if (position == 1) {
            /* 15644 */
            skillLevel = Randomizer.rand(firstmin, firstmax);
            /*       */
        } else {
            /* 15646 */
            skillLevel = Randomizer.rand(1, Othermax);
            /*       */
        }
        /*       */
        /* 15649 */
        if (skillLevel > skill.getMaxLevel()) {
            /* 15650 */
            skillLevel = skill.getMaxLevel();
            /*       */
        }
        /* 15652 */
        System.out.println("第 " + position + " 技能:" + skill.getName() + "(" + skill.getId() + ") 随机出来的等级:" + skillLevel + " 技能的最大等级:" + skill.getMaxLevel());
        /* 15653 */
        return new InnerSkillEntry(randomSkill, skillLevel, (byte) position, (byte) rank);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void gainItem(int code, int amount, String log) {
        /* 15658 */
        MapleInventoryManipulator.addById(this.client, code, (short) amount, log);
        /*       */
    }

    /*       */
    /*       */
    public void fixOnlineTime() {
        /* 15662 */
        int day = getIntRecord(99999);
        /* 15663 */
        int enter = getIntNoRecord(99998);
        /* 15664 */
        if (enter > 0 && getDay() != day) {
            /* 15665 */
            setTodayOnlineTime(0);
            /* 15666 */
            initTodayOnlineTime();
            /*       */
        }
        /* 15668 */
        updateTodayDate();
        /* 15669 */
        updataEnterShop(false);
        /*       */
    }

    /*       */
    /*       */
    public int getDay() {
        /* 15673 */
        Calendar c = Calendar.getInstance();
        /* 15674 */
        return c.get(5);
        /*       */
    }

    /*       */
    /*       */
    public void updataEnterShop(boolean enter) {
        /* 15678 */
        getQuestNAdd(MapleQuest.getInstance(99998)).setCustomData(enter ? String.valueOf(1) : String.valueOf(0));
        /*       */
    }

    /*       */
    /*       */
    public Calendar getDaybyDay(int n2) {
        /* 15682 */
        Calendar calendar = Calendar.getInstance();
        /* 15683 */
        calendar.set(5, calendar.get(5) + n2);
        /* 15684 */
        calendar.set(11, 0);
        /* 15685 */
        calendar.set(9, 0);
        /* 15686 */
        calendar.set(10, 0);
        /* 15687 */
        calendar.set(12, 0);
        /* 15688 */
        calendar.set(13, 0);
        /* 15689 */
        calendar.set(14, 0);
        /* 15690 */
        return calendar;
        /*       */
    }

    /*       */
    /*       */
    public void setOnlineTime() {
        /* 15694 */
        if (getLogintime() > 0L) {
            /* 15695 */
            long l2 = getDaybyDay(1).getTimeInMillis() - getLogintime();
            /* 15696 */
            if (this.onlineTime < 0L) {
                /* 15697 */
                resetEventCount("OnlineTime", 0);
                /*       */
            }
            /* 15699 */
            setEventCount("OnlineTime", 0, (int) (System.currentTimeMillis() - ((l2 >= 86400000L) ? (getDaybyDay(1).getTimeInMillis() - 86400000L) : getLogintime())));
            /* 15700 */
            setLogintime(System.currentTimeMillis());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void initOnlineTime() {
        /* 15705 */
        this.onlineTime = getEventCount("OnlineTime", 0);
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getOnlineTime() {
        /* 15710 */
        long l2, l3 = getDaybyDay(1).getTimeInMillis() - getLogintime();
        /* 15711 */
        if (this.onlineTime < 0L) {
            /* 15712 */
            resetEventCount("OnlineTime", 0);
            /* 15713 */
            initOnlineTime();
            /*       */
        }
        /* 15715 */
        if (l3 >= 86400000L) {
            /* 15716 */
            l2 = getDaybyDay(1).getTimeInMillis() - 86400000L;
            /* 15717 */
            setLogintime(getDaybyDay(0).getTimeInMillis());
            /*       */
        } else {
            /* 15719 */
            l2 = getLogintime() - this.onlineTime;
            /*       */
        }
        /* 15721 */
        return (int) (System.currentTimeMillis() - l2);
        /*       */
    }

    /*       */
    /*       */
    public void setOnlineTime(long onlineTime) {
        /* 15725 */
        this.onlineTime = onlineTime;
        /*       */
    }

    /*       */
    /*       */
    public long getLTime() {
        /* 15729 */
        return this.ltime;
        /*       */
    }

    /*       */
    /*       */
    public void setLTime() {
        /* 15733 */
        this.ltime = System.currentTimeMillis();
        /*       */
    }

    /*       */
    /*       */
    public void updateTodayDate() {
        /* 15737 */
        getQuestNAdd(MapleQuest.getInstance(99999)).setCustomData(String.valueOf(getDay()));
        /*       */
    }

    /*       */
    /*       */
    public int getTodayOnlineTime() {
        /* 15741 */
        return this.todayonlinetime + (int) ((System.currentTimeMillis() - this.todayonlinetimestamp.getTime()) / 60000L);
        /*       */
    }

    /*       */
    /*       */
    public void setTodayOnlineTime(int time) {
        /* 15745 */
        this.todayonlinetime = time;
        /*       */
    }

    /*       */
    /*       */
    public int getTotalOnlineTime() {
        /* 15749 */
        return this.totalonlinetime + (int) ((System.currentTimeMillis() - this.todayonlinetimestamp.getTime()) / 60000L);
        /*       */
    }

    /*       */
    /*       */
    public void initTodayOnlineTime() {
        /* 15753 */
        this.todayonlinetimestamp = new Timestamp(System.currentTimeMillis());
        /*       */
    }

    /*       */
    /*       */
    public void finishActivity(int questid) {
        /* 15757 */
        MapleActivity.finish(this, questid);
        /*       */
    }

    /*       */
    /*       */
    public final void openNpc(int id) {
        /* 15761 */
        openNpc(id, (String) null);
        /*       */
    }

    /*       */
    /*       */
    public final void openNpc(int id, String mode) {
        /* 15765 */
        getClient().removeClickedNPC();
        /* 15766 */
        NPCScriptManager.getInstance().dispose(getClient());
        /* 15767 */
        NPCScriptManager.getInstance().start(getClient(), id, mode);
        /*       */
    }

    /*       */
    /*       */
    public void updateVisitorKills(int n2, int n3) {
        /* 15771 */
        this.client.announce(MaplePacketCreator.updateVisitorKills(n2, n3));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkNameLevel() {
        /* 15778 */
        if (!this.questinfo.containsKey(Integer.valueOf(18127))) {
            /* 15779 */
            updateInfoQuest(18127, "ago=" + getVip() + ";step=0;gD=14/08/08;FP=25;adm=1", false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void ForceConFull() {
        /* 15788 */
        this.specialStats.setForceCon(1000);
        /*       */
        /* 15790 */
        this.specialStats.setForceCon2(0);
        /*       */
        /* 15792 */
        MapleStatEffect skillEffect = getSkillEffect(3310006);
        /* 15793 */
        if (skillEffect != null) {
            /* 15794 */
            getClient().getSession().write(EffectPacket.showOwnBuffEffect(skillEffect.getSourceid(), 1, getLevel(), this.level));
            /* 15795 */
            getMap().broadcastMessage(this, EffectPacket.showBuffeffect(this, skillEffect.getSourceid(), 1, getLevel(), this.level), false);
            /* 15796 */
            skillEffect.applyTo(this, true);
            /*       */
        }
        /*       */
        /* 15799 */
        this.client.getSession().write(BuffPacket.showforceCon(this.specialStats.getForceCon(), this.specialStats.getForceCon2(), this.job, true));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addForceCon(int forceCon, boolean ExforceCon) {
        /* 15806 */
        this.specialStats.gainForceCon(forceCon);
        /* 15807 */
        if (this.specialStats.getForceCon() < 0) {
            /* 15808 */
            this.specialStats.setForceCon(0);
            /*       */
        }
        /* 15810 */
        if (this.specialStats.getForceCon() > 1000) {
            /* 15811 */
            this.specialStats.setForceCon(1000);
            /*       */
        }
        /* 15813 */
        if (ExforceCon &&
                /* 15814 */       this.specialStats.getForceCon() < 1000) {
            /*       */
            /* 15816 */
            this.specialStats.gainForceCon2(forceCon);
            /* 15817 */
            if (this.specialStats.getForceCon2() >= 1000) {
                /* 15818 */
                this.specialStats.setForceCon2(this.specialStats.getForceCon2() - 1000);
                /*       */
                /* 15820 */
                MapleStatEffect skillEffect = getSkillEffect(3310006);
                /* 15821 */
                if (skillEffect != null) {
                    /* 15822 */
                    getClient().getSession().write(EffectPacket.showOwnBuffEffect(skillEffect.getSourceid(), 1, getLevel(), this.level));
                    /* 15823 */
                    getMap().broadcastMessage(this, EffectPacket.showBuffeffect(this, skillEffect.getSourceid(), 1, getLevel(), this.level), false);
                    /* 15824 */
                    skillEffect.applyTo(this, true);
                    /*       */
                }
                /*       */
                /* 15827 */
                if (this.specialStats.getForceCon2() < 0) {
                    /* 15828 */
                    this.specialStats.setForceCon(0);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
        /*       */
        /* 15834 */
        this.client.getSession().write(BuffPacket.showforceCon(this.specialStats.getForceCon(), this.specialStats.getForceCon2(), this.job, true));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void updateWenYang(int wenyang) {
        /* 15842 */
        int nowWenYang = this.specialStats.getWenyang();
        /*       */
        /* 15844 */
        this.specialStats.setWenYang(wenyang);
        /*       */
        /* 15846 */
        if (this.specialStats.getWenyang() < 0 || this.specialStats.getWenyang() > 4) {
            /* 15847 */
            this.specialStats.setWenYang(0);
            /*       */
        }
        /*       */
        /* 15850 */
        this.client.getSession().write(BuffPacket.show纹样(wenyang, nowWenYang));
        /*       */
    }

    /*       */
    /*       */
    public void handle更新纹样(int skillid) {
        /* 15854 */
        switch (skillid) {
            /*       */
            case 3011004:
                /*       */
            case 3300002:
                /*       */
            case 3321003:
                /* 15858 */
                updateWenYang(1);
                /*       */
                break;
            /*       */
            case 3301003:
                /*       */
            case 3301004:
                /*       */
            case 3310001:
                /*       */
            case 3311013:
                /*       */
            case 3321004:
                /*       */
            case 3321005:
                /* 15866 */
                updateWenYang(2);
                /*       */
                break;
            /*       */
            case 3311002:
                /*       */
            case 3311003:
                /*       */
            case 3321006:
                /*       */
            case 3321007:
                /* 15872 */
                updateWenYang(3);
                /*       */
                break;
            /*       */
            case 3321014:
                /*       */
            case 3321015:
                /*       */
            case 3321016:
                /*       */
            case 3321017:
                /*       */
            case 3321018:
                /*       */
            case 3321019:
                /*       */
            case 3321020:
                /*       */
            case 3321021:
                /*       */
            case 3321035:
                /*       */
            case 3321036:
                /*       */
            case 3321037:
                /*       */
            case 3321038:
                /*       */
            case 3321039:
                /*       */
            case 3321040:
                /*       */
            case 400031037:
                /*       */
            case 400031038:
                /*       */
            case 400031039:
                /*       */
            case 400031040:
                /* 15892 */
                updateWenYang(0);
                /*       */
                break;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handle追加星爆(int skillid) {
        /* 15898 */
        MapleStatEffect skillEffect = getSkillEffect(3310004);
        /* 15899 */
        if (skillEffect != null &&
                /* 15900 */       skillEffect.makeChanceResult() &&
                /* 15901 */       getSpecialStat().getWenyang() == 2 && (
                /* 15902 */       skillid == 3011004 || skillid == 3300002 || skillid == 3321003)) {
            /*       */
            /* 15904 */
            List<MapleMapObject> arrayList = getMap().getMapObjectsInRange(getPosition(), 250000.0D, Collections.singletonList(MapleMapObjectType.MONSTER));
            /*       */
            /* 15906 */
            List<Integer> tomobids = new ArrayList<>();
            /* 15907 */
            for (MapleMapObject mobj : arrayList) {
                /* 15908 */
                tomobids.add(Integer.valueOf(mobj.getObjectId()));
                /*       */
            }
            /* 15910 */
            if (!tomobids.isEmpty()) {
                /* 15911 */
                getSpecialStat().gainForceCounter();
                /* 15912 */
                int attackCount = (getBuffSource(MapleBuffStat.SECONDARY_STAT_IndiePMdR) == 3321034) ? 3 : 2;
                /* 15913 */
                getClient().getSession().write(ForcePacket.追加释魂(getId(), 3310004, getSpecialStat().getForceCounter(), tomobids, attackCount, new Point((getPosition()).x + (isFacingLeft() ? -120 : 240), (getPosition()).y - 100), getPosition()));
                /* 15914 */
                getSpecialStat().gainForceCounter(1);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle追加释魂(int skillid) {
        /* 15923 */
        MapleStatEffect skillEffect = getSkillEffect(3300005);
        /* 15924 */
        if (skillEffect != null &&
                /* 15925 */       skillEffect.makeChanceResult())
            /*       */ {
            /* 15927 */
            if (getSpecialStat().getWenyang() == 1 && (
                    /* 15928 */         skillid == 3301004 || skillid == 3311013 || skillid == 3321004 || skillid == 3321005)) {
                /*       */
                /* 15930 */
                List<MapleMapObject> arrayList = getMap().getMapObjectsInRange(getPosition(), 250000.0D, Collections.singletonList(MapleMapObjectType.MONSTER));
                /*       */
                /* 15932 */
                List<Integer> tomobids = new ArrayList<>();
                /* 15933 */
                for (MapleMapObject mobj : arrayList) {
                    /* 15934 */
                    tomobids.add(Integer.valueOf(mobj.getObjectId()));
                    /*       */
                }
                /* 15936 */
                if (!tomobids.isEmpty()) {
                    /* 15937 */
                    getSpecialStat().gainForceCounter();
                    /* 15938 */
                    int attackCount = (getBuffSource(MapleBuffStat.SECONDARY_STAT_IndiePMdR) == 3321034) ? 4 : 3;
                    /* 15939 */
                    getClient().getSession().write(ForcePacket.追加释魂(getId(), 3300005, getSpecialStat().getForceCounter(), tomobids, attackCount, new Point((getPosition()).x + (isFacingLeft() ? -120 : 240), (getPosition()).y - 100), getPosition()));
                    /* 15940 */
                    getSpecialStat().gainForceCounter(1);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    public void handle削弱诅咒() {
        /*       */
        MapleStatEffect skillEffect;
        /* 15950 */
        switch (getJob()) {
            /*       */
            case 301:
                /* 15952 */
                if ((skillEffect = getSkillEffect(3010001)) != null) {
                    /* 15953 */
                    skillEffect.applyTo(this, true);
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 330:
                /* 15957 */
                if ((skillEffect = getSkillEffect(3300001)) != null) {
                    /* 15958 */
                    skillEffect.applyTo(this, true);
                    /*       */
                }
                /*       */
                break;
            /*       */
            case 331:
                /* 15962 */
                if ((skillEffect = getSkillEffect(3310000)) != null) {
                    /* 15963 */
                    skillEffect.applyTo(this, true);
                    /*       */
                }
                /*       */
                break;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    public void handle精神之箭(int skillid, MapleMonster monster) {
        /* 15972 */
        if (skillid == 3301008) {
            /*       */
            /* 15974 */
            List<MapleMapObject> arrayList = getMap().getMapObjectsInRange(monster.getPosition(), 250000.0D, Collections.singletonList(MapleMapObjectType.MONSTER));
            /*       */
            /* 15976 */
            List<Integer> tomobids = new ArrayList<>();
            /* 15977 */
            for (MapleMapObject mobj : arrayList) {
                /* 15978 */
                tomobids.add(Integer.valueOf(mobj.getObjectId()));
                /*       */
            }
            /* 15980 */
            getSpecialStat().gainForceCounter();
            /* 15981 */
            getClient().getSession().write(ForcePacket.精神之箭(getId(), 3301009, getSpecialStat().getForceCounter(), tomobids, 2, new Point((monster.getPosition()).x + (monster.isFacingLeft() ? -120 : 240), (monster.getPosition()).y - 100), monster.getPosition()));
            /* 15982 */
            getSpecialStat().gainForceCounter(1);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void AutoCelebrityCrit() {
        int skilllevel = this.getSkillLevel(4220015);
        if (skilllevel > 0 && this.celebrityCrit == null) {
            this.celebrityCrit = Timer.BuffTimer.getInstance().register(() -> {
                Skill crit = SkillFactory.getSkill(4220015);
                MapleStatEffect effect = crit.getEffect(skilllevel);
                Map<MapleBuffStat, Integer> stat = Collections.singletonMap(MapleBuffStat.暴击蓄能, skilllevel * 2);
                this.client.announce(BuffPacket.giveBuff(crit.getId(), 0, stat, effect, this));
            }, 10000L);
        }

    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void cannelAutoCelebrityCrit() {
        /* 16001 */
        if (this.celebrityCrit != null) {
            /* 16002 */
            this.celebrityCrit.cancel(true);
            /* 16003 */
            this.celebrityCrit = null;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void switchLuckyMoney(boolean on) {
        /* 16008 */
        if (on && this.luckymoney) {
            /*       */
            return;
            /*       */
        }
        /* 16011 */
        this.luckymoney = on;
        /* 16012 */
        this.client.announce(BuffPacket.switchLuckyMoney(on));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void changeDamageSkin(int id) {
        /* 16029 */
        MapleQuest q = MapleQuest.getInstance(7291);
        /* 16030 */
        if (q == null) {
            /*       */
            return;
            /*       */
        }
        /* 16033 */
        MapleQuestStatus status = getQuestNAdd(q);
        /* 16034 */
        status.setStatus((byte) 1);
        /* 16035 */
        status.setCustomData(String.valueOf(id));
        /* 16036 */
        updateQuest(status, true);
        /* 16037 */
        this.client.getSession().write(MaplePacketCreator.updateDamageSkin(this, 2));
        /* 16038 */
        this.client.getSession().write(EffectPacket.showDamageSkin(this));
        /* 16039 */
        this.map.broadcastMessage(InventoryPacket.showDamageSkin(getId(), id));
        /* 16040 */
        dropMessage(-9, "伤害皮肤已变更。");
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getDamageSkin() {
        /* 16047 */
        if (JobConstants.is神之子(this.job)) {
            /* 16048 */
            return 0;
            /*       */
        }
        /* 16050 */
        MapleQuestStatus stat = getQuestNAdd(MapleQuest.getInstance(7291));
        /* 16051 */
        stat.setStatus((byte) 1);
        /* 16052 */
        if (stat.getCustomData() == null) {
            /* 16053 */
            stat.setCustomData("0");
            /*       */
        }
        /* 16055 */
        return Integer.parseInt(stat.getCustomData());
        /*       */
    }

    /*       */
    /*       */
    public final void insertRanking(String rankingname, int value) {
        /* 16059 */
        RankingTop.getInstance().insertRanking(this, rankingname, value);
        /*       */
    }

    /*       */
    /*       */
    public void getNpcNotice(int npcid, String text, int time) {
        /* 16063 */
        getClient().announce(UIPacket.getNpcNotice(npcid, text, time * 1000));
        /*       */
    }

    /*       */
    /*       */
    public synchronized Channel getChatSession() {
        /* 16067 */
        return this.chatSession;
        /*       */
    }

    /*       */
    /*       */
    public void setChatSession(Channel session) {
        /* 16071 */
        this.chatSession = session;
        /*       */
    }

    /*       */
    /*       */
    public int getWeaponPoint() {
        /* 16075 */
        return this.weaponPoint;
        /*       */
    }

    /*       */
    /*       */
    public void setWeaponPoint(int wp) {
        /* 16079 */
        this.weaponPoint = wp;
        /* 16080 */
        this.client.announce(MaplePacketCreator.showGainWeaponPoint(wp));
        /* 16081 */
        this.client.announce(MaplePacketCreator.updateWeaponPoint(getWeaponPoint()));
        /*       */
    }

    /*       */
    /*       */
    public void gainWeaponPoint(int wp) {
        /* 16085 */
        this.weaponPoint += wp;
        /* 16086 */
        if (wp > 0) {
            /* 16087 */
            this.client.announce(MaplePacketCreator.showGainWeaponPoint(wp));
            /*       */
        }
        /* 16089 */
        this.client.announce(MaplePacketCreator.updateWeaponPoint(getWeaponPoint()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public Map<String, Integer> getCredits() {
        /* 16098 */
        return this.credit;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setCredit(String name, int value) {
        /* 16108 */
        this.credit.put(name, Integer.valueOf(value));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainCredit(String name, int value) {
        /* 16118 */
        this.credit.put(name, Integer.valueOf(getCredit(name) + value));
        /*       */
    }

    /*       */
    /*       */
    public int getCredit(String name) {
        /* 16122 */
        if (this.credit.containsKey(name)) {
            /* 16123 */
            return ((Integer) this.credit.get(name)).intValue();
            /*       */
        }
        /* 16125 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public int getHayatoPoint() {
        /* 16129 */
        return this.specialStats.getHayatoPoint();
        /*       */
    }

    /*       */
    /*       */
    public void setHayatoPoint(int jianqi) {
        /* 16133 */
        this.specialStats.setJianQi(jianqi);
        /* 16134 */
        getClient().announce(MaplePacketCreator.updateJianQi(this.specialStats.getHayatoPoint()));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void gainHayatoPoint(int hayatoPoint) {
        /* 16141 */
        this.specialStats.gainHayatoPoint(hayatoPoint);
        /* 16142 */
        getClient().announce(MaplePacketCreator.updateJianQi(this.specialStats.getHayatoPoint()));
        /*       */
    }

    /*       */
    /*       */
    public boolean checkSoulWeapon() {
        /* 16146 */
        Equip weapon = (Equip) getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11);
        /* 16147 */
        return (weapon != null && weapon.getSoulEnchanter() != 0);
        /*       */
    }

    /*       */
    /*       */
    public boolean isSoulWeapon(Equip equip) {
        /* 16151 */
        return (equip != null && equip.getSoulEnchanter() != 0);
        /*       */
    }

    /*       */
    /*       */
    public void equipSoulWeapon(Equip equip) {
        /* 16155 */
        changeSkillLevel(new Skill(getEquippedSoulSkill()), (byte) -1, (byte) 0);
        /* 16156 */
        changeSkillLevel(new Skill(equip.getSoulSkill()), (byte) 1, (byte) 1);
        /* 16157 */
        setSoulCount((short) 0);
        /* 16158 */
        getClient().announce(BuffPacket.giveSoulGauge(getSoulCount(), equip.getSoulSkill()));
        /*       */
    }

    /*       */
    /*       */
    public void unequipSoulWeapon(Equip equip) {
        /* 16162 */
        changeSkillLevel(new Skill(equip.getSoulSkill()), (byte) -1, (byte) 0);
        /* 16163 */
        setSoulCount((short) 0);
        /*       */
        /* 16165 */
        getClient().announce(BuffPacket.cancelSoulGauge());
        /* 16166 */
        getMap().broadcastMessage(BuffPacket.cancelForeignSoulEffect(getId()));
        /*       */
    }

    /*       */
    /*       */
    public void writeSoulPacket() {
        /* 16170 */
        int soulSkill = getEquippedSoulSkill();
        /* 16171 */
        getClient().announce(BuffPacket.giveSoulGauge(addgetSoulCount(), soulSkill));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void checkSoulState(boolean useskill) {
        /* 16203 */
        int skillid = getEquippedSoulSkill();
        /* 16204 */
        Skill skill = SkillFactory.getSkill(skillid);
        /* 16205 */
        if (skill != null) {
            /* 16206 */
            MapleStatEffect effect = skill.getEffect(getSkillLevel(skillid));
            /* 16207 */
            long cooldown = getCooldownLimit(skillid);
            /*       */
            /* 16209 */
            if (useskill) {
                /* 16210 */
                if (getSoulCount() >= effect.getSoulMpCon()) {
                    /* 16211 */
                    List<ModifyInventory> mods = new ArrayList<>();
                    /*       */
                    /* 16213 */
                    getClient().announce(BuffPacket.giveSoulEffect(getEquippedSoulSkill()));
                    /*       */
                    /* 16215 */
                    setSoulCount((short) (getSoulCount() - effect.getSoulMpCon()));
                    /*       */
                    /* 16217 */
                    getClient().announce(BuffPacket.giveSoulGauge(getSoulCount(), getEquippedSoulSkill()));
                    /*       */
                    /* 16219 */
                    getClient().announce(BuffPacket.cancelSoulEffect());
                    /*       */
                    /*       */
                    /*       */
                    /* 16223 */
                    getMap().broadcastMessage(this, BuffPacket.cancelForeignSoulEffect(this), false);
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /*       */
                    /* 16232 */
                    this.client.announce(InventoryPacket.modifyInventory(true, mods, this));
                    /*       */
                }
                /* 16234 */
            } else if (getSoulCount() >= effect.getSoulMpCon() &&
                    /* 16235 */         cooldown <= 0L) {
                /*       */
                /* 16237 */
                getClient().announce(BuffPacket.giveSoulEffect(skillid));
                /*       */
                /* 16239 */
                getMap().broadcastMessage(this, BuffPacket.giveForeignSoulEffect(getId(), skillid), false);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public short getSoulCount() {
        /* 16246 */
        return this.soulcount;
        /*       */
    }

    /*       */
    /*       */
    public void setSoulCount(short soulcount) {
        /* 16250 */
        this.soulcount = (soulcount > 1000) ? 1000 : soulcount;
        /*       */
    }

    /*       */
    /*       */
    public void addSoulCount() {
        /* 16254 */
        if (this.soulcount < 1000) {
            /* 16255 */
            this.soulcount = (short) (this.soulcount + 1);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public short addgetSoulCount() {
        /* 16260 */
        addSoulCount();
        /* 16261 */
        return getSoulCount();
        /*       */
    }

    /*       */
    /*       */
    public int getEquippedSoulSkill() {
        /* 16265 */
        Equip weapon = (Equip) getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11);
        /* 16266 */
        if (weapon == null) {
            /* 16267 */
            return 0;
            /*       */
        }
        /* 16269 */
        return weapon.getSoulSkill();
        /*       */
    }

    /*       */
    /*       */
    public int getSoulSkillMpCon() {
        /* 16273 */
        int skillid = getEquippedSoulSkill();
        /* 16274 */
        Skill skill = SkillFactory.getSkill(skillid);
        /*       */
        MapleStatEffect effect;
        /* 16276 */
        if (skill != null && (effect = skill.getEffect(getSkillLevel(skillid))) != null) {
            /* 16277 */
            return effect.getSoulMpCon();
            /*       */
        }
        /* 16279 */
        return 0;
        /*       */
    }

    /*       */
    /*       */
    public void iNeedSystemProcess() {
        /* 16283 */
        setLastCheckProcess(System.currentTimeMillis());
        /* 16284 */
        getClient().announce(MaplePacketCreator.SystemProcess());
        /*       */
    }

    /*       */
    /*       */
    public long getLastCheckProcess() {
        /* 16288 */
        return this.lastCheckProcess;
        /*       */
    }

    /*       */
    /*       */
    public void setLastCheckProcess(long lastCheckProcess) {
        /* 16292 */
        this.lastCheckProcess = lastCheckProcess;
        /*       */
    }

    /*       */
    /*       */
    public List<MapleProcess> getProcess() {
        /* 16296 */
        return this.Process;
        /*       */
    }

    /*       */
    /*       */
    public void send(byte[] array) {
        /* 16300 */
        getClient().announce(array);
        /*       */
    }

    /*       */
    /*       */
    public void send_other(byte[] array, boolean b) {
        /* 16304 */
        getMap().broadcastMessage(this, array, b);
        /*       */
    }

    /*       */
    /*       */
    public List<Integer> getEffectSwitch() {
        /* 16308 */
        return this.effectSwitch;
        /*       */
    }

    /*       */
    /*       */
    public void updateEffectSwitch(int pos) {
        /* 16312 */
        for (Integer poss : this.effectSwitch) {
            /* 16313 */
            if (poss.intValue() == pos) {
                /* 16314 */
                this.effectSwitch.remove(poss);
                /*       */
                return;
                /*       */
            }
            /*       */
        }
        /* 16318 */
        this.effectSwitch.add(Integer.valueOf(pos));
        /*       */
    }

    /*       */
    /*       */
    public void gainPP(int pp) {
        /* 16322 */
        this.specialStats.gainPP(pp);
        /* 16323 */
        this.client.announce(BuffPacket.showPP(this.specialStats.getPP(), this.job));
        /*       */
    }

    /*       */
    /*       */
    public int getMobKills() {
        /* 16327 */
        return this.mobKills;
        /*       */
    }

    /*       */
    /*       */
    public void setMobKills(int mobKills) {
        /* 16331 */
        this.mobKills = mobKills;
        /*       */
    }

    /*       */
    /*       */
    public void gainMobKills(int mobKills) {
        /* 16335 */
        this.mobKills += mobKills;
        /*       */
    }

    /*       */
    /*       */
    public long getLastMobKillTime() {
        /* 16339 */
        return this.lastMobKillTime;
        /*       */
    }

    /*       */
    /*       */
    public void setLastMobKillTime(long lastMobKillTime) {
        /* 16343 */
        this.lastMobKillTime = lastMobKillTime;
        /*       */
    }

    /*       */
    /*       */
    public void handle影子分裂(int oid, Point point) {
        /* 16347 */
        Skill BuffSkill = SkillFactory.getSkill(14001027);
        /* 16348 */
        Skill skill_1 = SkillFactory.getSkill(14001027);
        /* 16349 */
        Skill skill_2 = SkillFactory.getSkill(14100027);
        /* 16350 */
        Skill skill_4 = SkillFactory.getSkill(14120008);
        /* 16351 */
        int skillLevel_1 = getSkillLevel(BuffSkill);
        /* 16352 */
        int skillLevel_2 = getSkillLevel(skill_2);
        /* 16353 */
        int skillLevel_4 = getSkillLevel(skill_4);
        /* 16354 */
        if (skillLevel_1 < 0) {
            /*       */
            return;
            /*       */
        }
        /* 16357 */
        MapleStatEffect effect = BuffSkill.getEffect(skillLevel_1);
        /* 16358 */
        int prop = effect.getProp();
        /*       */
        /* 16360 */
        if (skillLevel_2 > 0) {
            /* 16361 */
            prop += skill_2.getEffect(skillLevel_2).getProp();
            /*       */
        }
        /*       */
        /* 16364 */
        if (skillLevel_4 > 0) {
            /* 16365 */
            prop += skill_2.getEffect(skillLevel_4).getProp();
            /*       */
        }
        /*       */
        /* 16368 */
        if (Randomizer.nextInt(100) > prop) {
            /* 16369 */
            this.specialStats.gainForceCounter();
            /* 16370 */
            getMap().broadcastMessage(ForcePacket.Show影子蝙蝠锁定(getId(), 14000028, oid, 1, point, this.specialStats.getForceCounter()), getTruePosition());
            /* 16371 */
            this.specialStats.gainForceCounter();
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handle达克鲁秘卷() {
        /* 16376 */
        MapleStatEffect skillEffect = getSkillEffect(400041038);
        /* 16377 */
        if (skillEffect != null) {
            /*       */
            /* 16379 */
            List<MapleMapObject> list = getMap().getMapObjectsInRect(MapleStatEffectFactory.calculateBoundingBox(skillEffect, getPosition(), isFacingLeft()), Collections.singletonList(MapleMapObjectType.MONSTER));
            /*       */
            /* 16381 */
            ArrayList<Integer> arrayList = new ArrayList<>();
            /*       */
            /* 16383 */
            list.forEach(mob -> arrayList.add(Integer.valueOf(mob.getObjectId())));
            /*       */
            /*       */
            /* 16386 */
            if (arrayList.isEmpty()) {
                /*       */
                return;
                /*       */
            }
            /*       */
            /* 16390 */
            MapleSummon summon = getSummonBySkill(400041038);
            /* 16391 */
            if (summon == null) {
                /*       */
                return;
                /*       */
            }
            /*       */
            /* 16395 */
            Rectangle rectangle = MapleStatEffectFactory.calculateBoundingBox(summon.getTruePosition(), true, new Point(-120, -100), new Point(100, 100), 0);
            /* 16396 */
            Item item = getInventory(MapleInventoryType.USE).getDartsSlot(this.level);
            /* 16397 */
            int cosumeItemID = (item != null) ? item.getItemId() : 0;
            /* 16398 */
            MapleForce mapleForce = new MapleForce(this.id, skillEffect.getSourceid(), 0, summon.getObjectId(), summon.getTruePosition(), MapleForceType.达克鲁秘卷, (byte) 1, arrayList, (byte) 0, skillEffect.getZ(), getMap(), skillEffect.getBulletCount());
            /* 16399 */
            this.client.announce(ForcePacket.showForce(mapleForce, null, cosumeItemID, rectangle));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void handle锁链术狂怒(MapleMonster monster) {
        /* 16405 */
        Optional.<Skill>ofNullable(SkillFactory.getSkill(400041035)).ifPresent(skill -> {
            /*       */
            int totalSkillLevel = getTotalSkillLevel(400041035);
            /*       */
            MapleStatEffect effect = skill.getEffect(totalSkillLevel);
            /*       */
            if (totalSkillLevel > 0 && effect != null && System.currentTimeMillis() >= getLastUseVSkillTime()) {
                /*       */
                int second = 6;
                /*       */
                setLastUseVSkillTime(System.currentTimeMillis() + (second * 100));
                /*       */
                this.client.announce(MobPacket.LockChainAttack(monster));
                /*       */
            }
            /*       */
        });
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle残影之矢() {
        /* 16420 */
        Optional.<Skill>ofNullable(SkillFactory.getSkill(400031020)).ifPresent(skill -> {
            /*       */
            int skillLevel = getTotalSkillLevel(skill);
            /*       */
            int second = 5;
            /*       */
            if (skillLevel > 0) {
                /*       */
                MapleStatEffect effect = skill.getEffect(skillLevel);
                /*       */
                if (!isSkillCooling(400031020)) {
                    /*       */
                    return;
                    /*       */
                }
                /*       */
                if (effect != null && System.currentTimeMillis() >= getLastUseVSkillTime()) {
                    /*       */
                    setLastUseVSkillTime(System.currentTimeMillis() + (second * 1000));
                    /*       */
                    effect.applyTo(this, true);
                    /*       */
                }
                /*       */
            }
            /*       */
        });
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public MapleSigninStatus getSigninStatus() {
        /* 16438 */
        return this.siginStatus;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void initSigninStatus() {
        /* 16445 */
        if (this.level >= 33) {
            /* 16446 */
            this.siginStatus = new MapleSigninStatus(getInfoQuest(7));
            /* 16447 */
            updateInfoQuest(9, MapleSignin.getCurrentTime(), false);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int getPQLog(String pqName) {
        /* 16453 */
        return getPQLog(pqName, 0);
        /*       */
    }

    /*       */
    /*       */
    public int getPQLog(String pqName, int times) {
        /* 16457 */
        return getPQLog(pqName, times, 1);
        /*       */
    }

    /*       */
    /*       */
    public int getDaysPQLog(String pqName, int times) {
        /* 16461 */
        return getDaysPQLog(pqName, 0, times);
        /*       */
    }

    /*       */
    /*       */
    public int getDaysPQLog(String pqName, int times, int day) {
        /* 16465 */
        return getPQLog(pqName, times, day);
        /*       */
    }

    /*       */
    /*       */
    public int getPQLog(String pqName, int times, int day) {
        /* 16469 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
            /* 16470 */
            int n4 = 0;
            /* 16471 */
            try (PreparedStatement ps = con.prepareStatement("SELECT `count`,`time` FROM pqlog WHERE characterid = ? AND pqname = ?")) {
                /* 16472 */
                ps.setInt(1, this.id);
                /* 16473 */
                ps.setString(2, pqName);
                /* 16474 */
                try (ResultSet rs = ps.executeQuery()) {
                    /* 16475 */
                    if (rs.next()) {
                        /* 16476 */
                        n4 = rs.getInt("count");
                        /* 16477 */
                        Timestamp timestamp = rs.getTimestamp("time");
                        /* 16478 */
                        rs.close();
                        /* 16479 */
                        ps.close();
                        /* 16480 */
                        if (times == 0) {
                            /*       */
                            int n5;
                            /* 16482 */
                            Calendar calendar = Calendar.getInstance();
                            /* 16483 */
                            Calendar calendar2 = Calendar.getInstance();
                            /* 16484 */
                            if (timestamp != null) {
                                /* 16485 */
                                calendar2.setTimeInMillis(timestamp.getTime());
                                /* 16486 */
                                calendar2.add(6, day);
                                /*       */
                            }
                            /* 16488 */
                            if (calendar.get(1) - calendar2.get(1) > 1) {
                                /* 16489 */
                                n5 = 0;
                                /* 16490 */
                            } else if (calendar.get(1) - calendar2.get(1) >= 0) {
                                /* 16491 */
                                if (calendar.get(1) - calendar2.get(1) > 0) {
                                    /* 16492 */
                                    calendar2.add(1, 1);
                                    /*       */
                                }
                                /* 16494 */
                                n5 = calendar.get(6) - calendar2.get(6);
                                /*       */
                            } else {
                                /* 16496 */
                                n5 = -1;
                                /*       */
                            }
                            /* 16498 */
                            if (n5 >= 0) {
                                /* 16499 */
                                n4 = 0;
                                /* 16500 */
                                try (PreparedStatement psi = con.prepareStatement("UPDATE pqlog SET count = 0, time = CURRENT_TIMESTAMP() WHERE characterid = ? AND pqname = ?")) {
                                    /* 16501 */
                                    psi.setInt(1, this.id);
                                    /* 16502 */
                                    psi.setString(2, pqName);
                                    /* 16503 */
                                    psi.executeUpdate();
                                    /*       */
                                }
                                /*       */
                            }
                            /*       */
                        }
                        /*       */
                    } else {
                        /* 16508 */
                        try (PreparedStatement pss = con.prepareStatement("INSERT INTO pqlog (characterid, pqname, count, type) VALUES (?, ?, ?, ?)")) {
                            /* 16509 */
                            pss.setInt(1, this.id);
                            /* 16510 */
                            pss.setString(2, pqName);
                            /* 16511 */
                            pss.setInt(3, 0);
                            /* 16512 */
                            pss.setInt(4, times);
                            /* 16513 */
                            pss.executeUpdate();
                            /*       */
                        }
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /* 16518 */
            return n4;
            /* 16519 */
        } catch (SQLException sQLException) {
            /* 16520 */
            System.err.println("Error while get pqlog: " + sQLException);
            /* 16521 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void setPQLog(String pqname) {
        /* 16526 */
        setPQLog(pqname, 0);
        /*       */
    }

    /*       */
    /*       */
    public void setPQLog(String pqname, int type) {
        /* 16530 */
        setPQLog(pqname, type, 1);
        /*       */
    }

    /*       */
    /*       */
    public void setPQLog(String pqname, int type, int count) {
        /* 16534 */
        int times = getPQLog(pqname, type);
        /* 16535 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 16536 */         PreparedStatement ps = con.prepareStatement("UPDATE pqlog SET count = ?, type = ?, time = CURRENT_TIMESTAMP() WHERE characterid = ? AND pqname = ?")) {
            /* 16537 */
            ps.setInt(1, times + count);
            /* 16538 */
            ps.setInt(2, type);
            /* 16539 */
            ps.setInt(3, this.id);
            /* 16540 */
            ps.setString(4, pqname);
            /* 16541 */
            ps.executeUpdate();
            /*       */
        }
        /* 16543 */ catch (SQLException sQLException) {
            /* 16544 */
            System.err.println("Error while set pqlog: " + sQLException);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void resetPQLog(String pqname) {
        /* 16549 */
        resetPQLog(pqname, 0);
        /*       */
    }

    /*       */
    /*       */
    public void resetPQLog(String pqname, int type) {
        /* 16553 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 16554 */         PreparedStatement ps = con.prepareStatement("UPDATE pqlog SET count = ?, type = ?, time = CURRENT_TIMESTAMP() WHERE characterid = ? AND pqname = ?")) {
            /* 16555 */
            ps.setInt(1, 0);
            /* 16556 */
            ps.setInt(2, type);
            /* 16557 */
            ps.setInt(3, this.id);
            /* 16558 */
            ps.setString(4, pqname);
            /* 16559 */
            ps.executeUpdate();
            /*       */
        }
        /* 16561 */ catch (SQLException e) {
            /* 16562 */
            System.err.println("Error while reset pqlog: " + e);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public long getPQPoint() {
        /* 16567 */
        return Long.valueOf((getOneInfo(7907, "point") != null) ? getOneInfo(7907, "point") : "0").longValue();
        /*       */
    }

    /*       */
    /*       */
    public void gainPQPoint(long point) {
        /* 16571 */
        updateOneInfo(7907, "point", String.valueOf(getPQPoint() + point));
        /*       */
    }

    /*       */
    /*       */
    public long getPQPoint(int pqid) {
        /* 16575 */
        return Long.valueOf((getOneInfo(pqid, "point") != null) ? getOneInfo(pqid, "point") : "0").longValue();
        /*       */
    }

    /*       */
    /*       */
    public void gainPQPoint(int pqid, long point) {
        /* 16579 */
        updateOneInfo(pqid, "point", String.valueOf(getPQPoint(pqid) + point));
        /*       */
    }

    /*       */
    /*       */
    public void doneSailQuestion() {
        /* 16583 */
        for (int i2 = 0; i2 <= 4; i2++) {
            /* 16584 */
            MapleQuest.getInstance(17003 + i2).complete(this, 0, null);
            /* 16585 */
            MapleQuest.getInstance(17003 + i2).complete(this, 0);
            /*       */
        }
        /* 16587 */
        updateInfoQuest(17008, "T=0;L=1;E=0");
        /*       */
    }

    /*       */
    /*       */
    public long getLogintime() {
        /* 16591 */
        return this.logintime;
        /*       */
    }

    /*       */
    /*       */
    public void setLogintime(long logintime) {
        /* 16595 */
        this.logintime = logintime;
        /*       */
    }

    /*       */
    /*       */
    public long getQuestDiffTime() {
        /* 16599 */
        return (System.currentTimeMillis() - this.logintime) / 1000L / 60L;
        /*       */
    }

    /*       */
    /*       */
    public boolean isAttclimit() {
        /* 16603 */
        return this.attclimit;
        /*       */
    }

    /*       */
    /*       */
    public void setAttclimit(boolean attclimit) {
        /* 16607 */
        this.attclimit = attclimit;
        /*       */
    }

    /*       */
    /*       */
    public WeakReference<MapleReactor> getReactor() {
        /* 16611 */
        return this.reactor;
        /*       */
    }

    /*       */
    /*       */
    public void setReactor(MapleReactor reactor) {
        /* 16615 */
        this.reactor = new WeakReference<>(reactor);
        /*       */
    }

    /*       */
    /*       */
    public boolean isMainWeapon(int jobid, int weapon) {
        /* 16619 */
        Item item = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11);
        /* 16620 */
        MapleWeaponType type = ItemConstants.getWeaponType((weapon != 0) ? weapon : ((item != null) ? item.getItemId() : 0));
        /* 16621 */
        switch (type) {
            /*       */
            case 没有武器:
                /* 16623 */
                return false;
            /*       */
            /*       */
            case 单手剑:
                /* 16626 */
                return (JobConstants.is英雄(jobid) || JobConstants.is圣骑士(jobid) || JobConstants.is米哈尔(jobid));
            /*       */
            /*       */
            case 双手剑:
                /* 16629 */
                return (JobConstants.is英雄(jobid) || JobConstants.is圣骑士(jobid) || JobConstants.is狂龙战士(jobid));
            /*       */
            /*       */
            case 单手斧:
                /* 16632 */
                return (JobConstants.is圣骑士(jobid) || JobConstants.is恶魔猎手(jobid));
            /*       */
            /*       */
            case 双手斧:
                /* 16635 */
                return JobConstants.is圣骑士(jobid);
            /*       */
            /*       */
            case 单手钝器:
                /* 16638 */
                return (JobConstants.is英雄(jobid) || JobConstants.is恶魔猎手(jobid));
            /*       */
            /*       */
            case 双手钝器:
                /* 16641 */
                return JobConstants.is英雄(jobid);
            /*       */
            /*       */
            case 矛:
                /* 16644 */
                return (JobConstants.is黑骑士(jobid) || JobConstants.is战神(jobid));
            /*       */
            /*       */
            case 枪:
                /* 16647 */
                return JobConstants.is黑骑士(jobid);
            /*       */
            /*       */
            case 弓:
                /* 16650 */
                return (JobConstants.is风灵使者(jobid) || JobConstants.is神射手(jobid));
            /*       */
            /*       */
            case 弩:
                /* 16653 */
                return (JobConstants.is箭神(jobid) || JobConstants.is豹弩游侠(jobid));
            /*       */
            /*       */
            case 双弩枪:
                /* 16656 */
                return JobConstants.is双弩精灵(jobid);
            /*       */
            /*       */
            case 短杖:
                /*       */
            case 长杖:
                /* 16660 */
                return (JobConstants.is魔法师(jobid) || JobConstants.is唤灵斗师(jobid));
            /*       */
            /*       */
            case 大剑:
                /*       */
            case 太刀:
                /* 16664 */
                return JobConstants.is神之子(jobid);
            /*       */
            /*       */
            case 手持火炮:
                /* 16667 */
                return JobConstants.is火炮手(jobid);
            /*       */
            /*       */
            case 双头杖:
                /* 16670 */
                return JobConstants.is夜光(jobid);
            /*       */
            /*       */
            case 灵魂手铳:
                /* 16673 */
                return JobConstants.is爆莉萌天使(jobid);
            /*       */
            /*       */
            case 亡命剑:
                /* 16676 */
                return JobConstants.is恶魔复仇者(jobid);
            /*       */
            /*       */
            case 能量剑:
                /* 16679 */
                return JobConstants.is尖兵(jobid);
            /*       */
            /*       */
            case 驯兽魔法棒:
                /* 16682 */
                return JobConstants.is林之灵(jobid);
            /*       */
            /*       */
            case 短刀:
                /*       */
            case 双刀副手:
                /* 16686 */
                return (JobConstants.is双刀(jobid) || JobConstants.is侠盗(jobid));
            /*       */
            /*       */
            case 特殊副手:
                /*       */
            case 手杖:
                /* 16690 */
                return JobConstants.is幻影(jobid);
            /*       */
            /*       */
            case 拳套:
                /* 16693 */
                return (JobConstants.is隐士(jobid) || JobConstants.is夜行者(jobid));
            /*       */
            /*       */
            case 指节:
                /* 16696 */
                return JobConstants.is冲锋队长(jobid);
            /*       */
            /*       */
            case 短枪:
                /* 16699 */
                return (JobConstants.is机械师(jobid) || JobConstants.is船长(jobid) || JobConstants.is龙的传人(jobid));
            /*       */
            /*       */
            case 武士刀:
                /* 16702 */
                return JobConstants.is剑豪(jobid);
            /*       */
            /*       */
            case 折扇:
                /* 16705 */
                return JobConstants.is阴阳师(jobid);
            /*       */
            /*       */
            case 机甲手枪:
                /* 16708 */
                return JobConstants.is爆破手(jobid);
            /*       */
            /*       */
            case 调谐器:
                /* 16711 */
                return JobConstants.is御剑骑士(jobid);
            /*       */
        }
        /* 16713 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public void sendEnableActions() {
        /* 16717 */
        getClient().announce(MaplePacketCreator.enableActions());
        /*       */
    }

    /*       */
    /*       */
    public List<Integer> getDamSkinList() {
        /* 16721 */
        return this.damSkinList;
        /*       */
    }

    /*       */
    /*       */
    public void initAllInfo() {
        /* 16725 */
        if (getInfoQuest(1).isEmpty()) {
            /* 16726 */
            updateInfoQuest(1, "accept=1;date=15/06/25", false);
            /*       */
        }
        /* 16728 */
        if (getInfoQuest(7).isEmpty()) {
            /* 16729 */
            updateInfoQuest(7, "count=0;day=0;date=0;nowMonth=0", false);
            /*       */
        }
        /* 16731 */
        initDamageSkinList();
        /*       */
    }

    /*       */
    /*       */
    public void initDamageSkinList() {
        /* 16735 */
        String keyValue = getKeyValue("DAMAGE_SKIN");
        /* 16736 */
        String keyValue2 = getKeyValue("DAMAGE_SKIN_SLOT");
        /* 16737 */
        if (keyValue != null && !keyValue.isEmpty()) {
            /* 16738 */
            String[] split = keyValue.split(",");
            /* 16739 */
            for (String aSplit : split) {
                /* 16740 */
                if (!aSplit.isEmpty()) {
                    /* 16741 */
                    int intValue = Integer.valueOf(aSplit).intValue();
                    /* 16742 */
                    if (!getDamSkinList().contains(Integer.valueOf(intValue))) {
                        /* 16743 */
                        getDamSkinList().add(Integer.valueOf(intValue));
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 16748 */
        if (keyValue2 == null || keyValue2.isEmpty()) {
            /* 16749 */
            setKeyValue("DAMAGE_SKIN_SLOT", "1");
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getHyPay(int type) {
        /* 16757 */
        int pay = 0;
        /* 16758 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 16759 */         PreparedStatement ps = con.prepareStatement("SELECT * FROM hypay WHERE accname = ?")) {
            /* 16760 */
            ps.setString(1, getClient().getAccountName());
            /* 16761 */
            try (ResultSet rs = ps.executeQuery()) {
                /* 16762 */
                if (rs.next()) {
                    /* 16763 */
                    if (type == 1) {
                        /* 16764 */
                        pay = rs.getInt("pay");
                        /* 16765 */
                    } else if (type == 2) {
                        /* 16766 */
                        pay = rs.getInt("payUsed");
                        /* 16767 */
                    } else if (type == 3) {
                        /* 16768 */
                        pay = rs.getInt("pay") + rs.getInt("payUsed");
                        /* 16769 */
                    } else if (type == 4) {
                        /* 16770 */
                        pay = rs.getInt("payReward");
                        /*       */
                    } else {
                        /* 16772 */
                        pay = 0;
                        /*       */
                    }
                    /*       */
                } else {
                    /* 16775 */
                    try (PreparedStatement psu = con.prepareStatement("INSERT INTO hypay (accname, pay, payUsed, payReward) VALUES (?, ?, ?, ?)")) {
                        /* 16776 */
                        psu.setString(1, getClient().getAccountName());
                        /* 16777 */
                        psu.setInt(2, 0);
                        /* 16778 */
                        psu.setInt(3, 0);
                        /* 16779 */
                        psu.setInt(4, 0);
                        /* 16780 */
                        psu.executeUpdate();
                        /*       */
                    }
                    /*       */
                    /*       */
                }
                /*       */
            }
            /* 16785 */
        } catch (SQLException e) {
            /* 16786 */
            log.error("获取充值信息发生错误", e);
            /*       */
        }
        /* 16788 */
        return pay;
        /*       */
    }

    /*       */
    /*       */
    public int addHyPay(int hypay) {
        /* 16792 */
        int pay = getHyPay(1);
        /* 16793 */
        int payUsed = getHyPay(2);
        /* 16794 */
        int payReward = getHyPay(4);
        /* 16795 */
        if (hypay > pay) {
            /* 16796 */
            return -1;
            /*       */
        }
        /* 16798 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 16799 */         PreparedStatement ps = con.prepareStatement("UPDATE hypay SET pay = ? ,payUsed = ? ,payReward = ? WHERE accname = ?")) {
            /* 16800 */
            ps.setInt(1, pay - hypay);
            /* 16801 */
            ps.setInt(2, payUsed + hypay);
            /* 16802 */
            ps.setInt(3, payReward + hypay);
            /* 16803 */
            ps.setString(4, getClient().getAccountName());
            /* 16804 */
            ps.executeUpdate();
            /* 16805 */
            return 1;
            /*       */
        }
        /* 16807 */ catch (SQLException e) {
            /* 16808 */
            log.error("加减充值信息发生错误", e);
            /* 16809 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int gainHyPay(int hypay) {
        /* 16814 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 16815 */         PreparedStatement ps = con.prepareStatement("UPDATE hypay SET pay = pay + ? WHERE accname = ?")) {
            /* 16816 */
            ps.setInt(1, hypay);
            /* 16817 */
            ps.setString(2, getClient().getAccountName());
            /* 16818 */
            ps.executeUpdate();
            /* 16819 */
            return 1;
            /*       */
        }
        /* 16821 */ catch (SQLException e) {
            /* 16822 */
            log.error("加减充值信息发生错误", e);
            /* 16823 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int delPayReward(int pay) {
        /* 16828 */
        int payReward = getHyPay(4);
        /* 16829 */
        if (pay <= 0) {
            /* 16830 */
            return -1;
            /*       */
        }
        /* 16832 */
        if (pay > payReward) {
            /* 16833 */
            return -1;
            /*       */
        }
        /* 16835 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 16836 */         PreparedStatement ps = con.prepareStatement("UPDATE hypay SET payReward = ? WHERE accname = ?")) {
            /* 16837 */
            ps.setInt(1, payReward - pay);
            /* 16838 */
            ps.setString(2, getClient().getAccountName());
            /* 16839 */
            ps.executeUpdate();
            /* 16840 */
            return 1;
            /*       */
        }
        /* 16842 */ catch (SQLException ex) {
            /* 16843 */
            log.error("加减消费奖励信息发生错误", ex);
            /* 16844 */
            return -1;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getCyzjBuffTime() {
        /* 16852 */
        return this.cyzjbufftime;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void setCyzjBuffTime(int cyzjbufftime) {
        /* 16859 */
        this.cyzjbufftime = cyzjbufftime;
        /*       */
    }

    /*       */
    /*       */
    public void setXSmobOID(int XSmobOID) {
        /* 16863 */
        this.XSmobOID = XSmobOID;
        /*       */
    }

    /*       */
    /*       */
    public int getXSmobOID() {
        /* 16867 */
        return this.XSmobOID;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void gainCKZZ(int ckzz) {
        /* 16872 */
        List<MapleBlueSkySword> Sword = new ArrayList<>();
        /* 16873 */
        int jobs = 15002;
        /* 16874 */
        int max = (getJob() == 15112) ? 400 : 300;
        /*       */
        /* 16876 */
        this.specialStats.gainCKZZ(ckzz);
        /*       */
        /* 16878 */
        if (this.specialStats.getCKZZ() > max) {
            /* 16879 */
            this.specialStats.setCKZZ(max);
            /*       */
        }
        /*       */
        /* 16882 */
        this.client.announce(BuffPacket.showCKZZ(this.specialStats.getCKZZ(), jobs));
        /*       */
        /* 16884 */
        if (hasBuffSkill(151101006)) {
            /*       */
            /* 16886 */
            if (this.specialStats.isDZ1()) {
                /* 16887 */
                if (getSpecialStat().getCKZZ() <= 100) {
                    /* 16888 */
                    getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(this, 6));
                    /* 16889 */
                    getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(this, 7));
                    /* 16890 */
                    this.specialStats.setDZ1(false);
                    /*       */
                }
                /*       */
                /* 16893 */
            } else if (getSpecialStat().getCKZZ() > 100) {
                /* 16894 */
                for (int i = 0; i < 2; i++) {
                    /* 16895 */
                    Sword.add(new MapleBlueSkySword(this, 6 + i, 1 + i, 0, 0, 0, 0, getJob(), 0, 1, getPosition()));
                    /*       */
                }
                /* 16897 */
                getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(getId(), Sword, 0));
                /* 16898 */
                this.specialStats.setDZ1(true);
                /*       */
            }
            /*       */
            /*       */
            /* 16902 */
            if (this.specialStats.isDZ2()) {
                /* 16903 */
                if (getSpecialStat().getCKZZ() <= 200) {
                    /* 16904 */
                    getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(this, 8));
                    /* 16905 */
                    getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(this, 9));
                    /* 16906 */
                    this.specialStats.setDZ2(false);
                    /*       */
                }
                /*       */
                /* 16909 */
            } else if (getSpecialStat().getCKZZ() > 200) {
                /* 16910 */
                for (int i = 0; i < 2; i++) {
                    /* 16911 */
                    Sword.add(new MapleBlueSkySword(this, 8 + i, 3 + i, 0, 0, 0, 0, getJob(), 0, 1, getPosition()));
                    /*       */
                }
                /* 16913 */
                getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(getId(), Sword, 0));
                /* 16914 */
                this.specialStats.setDZ2(true);
                /*       */
            }
            /*       */
            /* 16917 */
            if (getJob() == 15112) {
                /* 16918 */
                if (this.specialStats.isDZ3()) {
                    /* 16919 */
                    if (getSpecialStat().getCKZZ() <= 300) {
                        /* 16920 */
                        getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(this, 10));
                        /* 16921 */
                        getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(this, 11));
                        /* 16922 */
                        this.specialStats.setDZ3(false);
                        /*       */
                    }
                    /*       */
                    /* 16925 */
                } else if (getSpecialStat().getCKZZ() > 300) {
                    /* 16926 */
                    for (int i = 0; i < 2; i++) {
                        /* 16927 */
                        Sword.add(new MapleBlueSkySword(this, 10 + i, 5 + i, 0, 0, 0, 0, getJob(), 0, 1, getPosition()));
                        /*       */
                    }
                    /* 16929 */
                    getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(getId(), Sword, 0));
                    /* 16930 */
                    this.specialStats.setDZ3(true);
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void doRecoveryCKZZ() {
        /* 16941 */
        this.specialStats.prepareRecoveryCKZZTime();
        /* 16942 */
        MapleStatEffect skillEffect = getSkillEffect(151100017);
        /* 16943 */
        int max = (getJob() == 15112) ? 400 : 300;
        /* 16944 */
        if (skillEffect != null && this.specialStats.getCKZZ() < max) {
            /* 16945 */
            gainCKZZ(skillEffect.getZ());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public boolean canRecoverCKZZ(long now) {
        /* 16950 */
        if (getJob() == 15110 || getJob() == 15111 || getJob() == 15112) {
            /* 16951 */
            MapleStatEffect skillEffect = getSkillEffect(151100017);
            /* 16952 */
            if (skillEffect == null) {
                /* 16953 */
                return false;
                /*       */
            }
            /* 16955 */
            int time = skillEffect.getW() * 1000;
            /* 16956 */
            return (this.specialStats.getLastRecoveryCKZZTime() > 0L && this.specialStats.getLastRecoveryCKZZTime() + time < now);
            /*       */
        }
        /* 16958 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public int get免费超时空券() {
        /* 16963 */
        return 7 - this.transWarpTicket;
        /*       */
    }

    /*       */
    /*       */
    public void initTransWarpTicket() {
        /* 16967 */
        this.transWarpTicket = getDaysPQLog("免费超时空券", 7);
        /*       */
    }

    /*       */
    /*       */
    public int get超时空券() {
        /* 16971 */
        String customData = getQuestNAdd(MapleQuest.getInstance(99997)).getCustomData();
        /* 16972 */
        if (customData == null) {
            /* 16973 */
            customData = "0";
            /*       */
        }
        /* 16975 */
        return Integer.parseInt(customData);
        /*       */
    }

    /*       */
    /*       */
    public void set超时空券(int n) {
        /* 16979 */
        getQuestNAdd(MapleQuest.getInstance(99997)).setCustomData(String.valueOf(n));
        /*       */
    }

    /*       */
    /*       */
    public void gainVCraftCore(int quantity) {
        /* 16983 */
        String data = getOneInfo(1477, "count");
        /* 16984 */
        if (data != null) {
            /* 16985 */
            int count = Integer.valueOf(data).intValue();
            /* 16986 */
            updateOneInfo(1477, "count", String.valueOf(count + quantity));
            /*       */
        } else {
            /* 16988 */
            updateOneInfo(1477, "count", String.valueOf(quantity));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public final void gainQuestPoint(int n, int n2) {
        /* 16993 */
        updateOneInfo(n, "point", String.valueOf(Math.max(0, getQuestPoint(n) + n2)));
        /*       */
    }

    /*       */
    /*       */
    public final int getQuestPoint(int n) {
        /* 16997 */
        return Integer.valueOf((getOneInfo(n, "point") != null) ? getOneInfo(n, "point") : "0").intValue();
        /*       */
    }

    /*       */
    /*       */
    public void check5thJobQuest() {
        /* 17001 */
        if (getQuestStatus(1465) == 1 && this.ltime > 10000000L) {
            /* 17002 */
            if (getQuestStatus(1474) == 1) {
                /* 17003 */
                if (System.currentTimeMillis() - this.ltime >= 3600000L) {
                    /* 17004 */
                    setLTime();
                    /* 17005 */
                    updateInfoQuest(1470, "on=1;remain=0;exp=500000000");
                    /* 17006 */
                    forceCompleteQuest(1474);
                    /*       */
                }
                /* 17008 */
            } else if (getQuestStatus(1475) == 1) {
                /* 17009 */
                if (System.currentTimeMillis() - this.ltime >= 3600000L) {
                    /* 17010 */
                    setLTime();
                    /* 17011 */
                    updateInfoQuest(1471, "on=1;remain=0;exp=500000000");
                    /* 17012 */
                    forceCompleteQuest(1475);
                    /*       */
                }
                /* 17014 */
            } else if (getQuestStatus(1476) == 1 && System.currentTimeMillis() - this.ltime >= 3600000L) {
                /* 17015 */
                setLTime();
                /* 17016 */
                updateInfoQuest(1472, "on=1;remain=0;exp=500000000");
                /* 17017 */
                forceCompleteQuest(1476);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public Map<Integer, VCoreSkillEntry> getVCoreSkill() {
        /* 17023 */
        return Collections.unmodifiableMap(this.vCoreSkills);
        /*       */
    }

    /*       */
    /*       */
    public void setVCoreSkills(Map<Integer, VCoreSkillEntry> vCoreSkills) {
        /* 17027 */
        this.vCoreSkills = vCoreSkills;
        /*       */
    }

    /*       */
    /*       */
    public void addVCoreSkill(VCoreSkillEntry ah2) {
        /* 17031 */
        this.vCoreSkills.put(Integer.valueOf(this.vCoreSkillIndex.getAndIncrement()), ah2);
        /* 17032 */
        this.changed_vcores = true;
        /*       */
    }

    /*       */
    /*       */
    public void setVCoreSkillSlot(int coreid, int slot) {
        /* 17036 */
        if (this.vCoreSkills.get(Integer.valueOf(coreid)) != null) {
            /* 17037 */
            ((VCoreSkillEntry) this.vCoreSkills.get(Integer.valueOf(coreid))).setSlot(slot);
            /* 17038 */
            this.changed_vcores = true;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void removeVCoreSkill(int coreid) {
        /* 17043 */
        if (this.vCoreSkills.get(Integer.valueOf(coreid)) != null) {
            /* 17044 */
            ((VCoreSkillEntry) this.vCoreSkills.get(Integer.valueOf(coreid))).setSlot(0);
            /* 17045 */
            this.changed_vcores = true;
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getVCoreSkillLevel(int skillid) {
        /* 17050 */
        int level = 0;
        /* 17051 */
        for (VCoreSkillEntry vse : this.vCoreSkills.values()) {
            /* 17052 */
            for (int i2 = 1; i2 <= 3; i2++) {
                /* 17053 */
                if (vse.getSlot() == 2 && vse.getSkill(i2) == skillid) {
                    /* 17054 */
                    if (vse.getType() == 0 || vse.getType() == 2) {
                        /* 17055 */
                        return vse.getLevel();
                        /*       */
                    }
                    /* 17057 */
                    if (vse.getType() == 1) {
                        /* 17058 */
                        level += vse.getLevel();
                        /*       */
                    }
                    /*       */
                }
                /*       */
            }
            /*       */
        }
        /* 17063 */
        return level;
        /*       */
    }

    /*       */
    /*       */
    public final boolean checkVCoreSkill(int n) {
        /* 17067 */
        for (VCoreSkillEntry vse : this.vCoreSkills.values()) {
            /* 17068 */
            if (vse.getSlot() == 2 && vse.getSkill(1) == n) {
                /* 17069 */
                return true;
                /*       */
            }
            /*       */
        }
        /* 17072 */
        return false;
        /*       */
    }

    /*       */
    /*       */
    public final Map<Integer, VMatrixSlotEntry> getVMatrixSlot() {
        /* 17076 */
        return this.vMatrixSlots;
        /*       */
    }

    /*       */
    /*       */
    public final int getNextVMatrixSlot() {
        /* 17080 */
        for (VMatrixSlotEntry vMatrixSlotEntry : this.vMatrixSlots.values()) {
            /* 17081 */
            if (vMatrixSlotEntry.getIndex() < 0) {
                /* 17082 */
                return vMatrixSlotEntry.getSlot();
                /*       */
            }
            /*       */
        }
        /* 17085 */
        return -1;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public final int getVMatrixPoint() {
        /* 17090 */
        int n = 50;
        /* 17091 */
        for (VMatrixSlotEntry vMatrixSlotEntry : this.vMatrixSlots.values()) {
            /* 17092 */
            n -= vMatrixSlotEntry.getExtend();
            /*       */
        }
        /* 17094 */
        return Math.max(n, 0);
        /*       */
    }

    /*       */
    /*       */
    public boolean isChanged_vcores() {
        /* 17098 */
        return this.changed_vcores;
        /*       */
    }

    /*       */
    /*       */
    public void setChanged_vcores(boolean changed_vcores) {
        /* 17102 */
        this.changed_vcores = changed_vcores;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void saveSkillInfo(boolean type) {
        /*       */
        try {
            /* 17124 */
            DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
            /* 17125 */
            if (type) {
                /* 17126 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM vcoreskill WHERE characterid = ?");
                /* 17127 */
                PreparedStatement ps = con.prepareStatement("INSERT INTO vcoreskill (`characterid`, `vcoreid`, `level`, `exp`, `skill1`, `skill2`, `skill3`, `slot`, `index`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ? )");
                /* 17128 */
                for (VCoreSkillEntry vCoreSkillEntry : this.vCoreSkills.values()) {
                    /* 17129 */
                    if (vCoreSkillEntry.getSlot() > 0) {
                        /* 17130 */
                        ps.setInt(1, getId());
                        /* 17131 */
                        ps.setInt(2, vCoreSkillEntry.getVcoreid());
                        /* 17132 */
                        ps.setInt(3, vCoreSkillEntry.getLevel());
                        /* 17133 */
                        ps.setInt(4, vCoreSkillEntry.getExp());
                        /* 17134 */
                        ps.setInt(5, vCoreSkillEntry.getSkill1());
                        /* 17135 */
                        ps.setInt(6, vCoreSkillEntry.getSkill2());
                        /* 17136 */
                        ps.setInt(7, vCoreSkillEntry.getSkill3());
                        /* 17137 */
                        ps.setInt(8, vCoreSkillEntry.getSlot());
                        /* 17138 */
                        ps.setInt(9, vCoreSkillEntry.getIndex());
                        /* 17139 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*       */
                }
                /*       */
                /* 17143 */
                ps.close();
                /*       */
            } else {
                /* 17145 */
                deleteWhereCharacterId((Connection) con, "DELETE FROM skills WHERE characterid = ?");
                /* 17146 */
                PreparedStatement ps = con.prepareStatement("INSERT INTO skills (characterid, skillid, skilllevel, masterlevel, expiration, teachId, position) VALUES (?, ?, ?, ?, ?, ?, ?)");
                /* 17147 */
                ps.setInt(1, this.id);
                /* 17148 */
                for (Map.Entry<Integer, SkillEntry> skill : this.skills.entrySet()) {
                    /* 17149 */
                    if (SkillConstants.isApplicableSkill(((Integer) skill.getKey()).intValue())) {
                        /* 17150 */
                        ps.setInt(2, ((Integer) skill.getKey()).intValue());
                        /* 17151 */
                        ps.setInt(3, ((SkillEntry) skill.getValue()).skillevel);
                        /* 17152 */
                        ps.setByte(4, ((SkillEntry) skill.getValue()).masterlevel);
                        /* 17153 */
                        ps.setLong(5, ((SkillEntry) skill.getValue()).expiration);
                        /* 17154 */
                        ps.setInt(6, ((SkillEntry) skill.getValue()).teachId);
                        /* 17155 */
                        ps.setByte(7, ((SkillEntry) skill.getValue()).position);
                        /* 17156 */
                        ps.executeUpdate();
                        /*       */
                    }
                    /*       */
                }
                /* 17159 */
                ps.close();
                /*       */
                /*       */
            }
            /*       */
            /*       */
        }
        /* 17164 */ catch (Exception exception) {
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void sendGiantBossMapChange(String string, String string2) {
        /* 17171 */
        send_other(MaplePacketCreator.sendGhostPoint(string, string2), true);
        /*       */
    }

    /*       */
    /*       */
    public void showPortal(String string, String string2) {
        /* 17175 */
        send_other(MaplePacketCreator.ShowPortal(string, Integer.valueOf(string2).intValue()), true);
        /*       */
    }

    /*       */
    /*       */
    public void gaintBossMap() {
        /* 17179 */
        Map<String, String> hashMap = new HashMap<>();
        /* 17180 */
        EventInstanceManager eim = getEventInstance();
        /* 17181 */
        for (Map.Entry<String, String> entry : (Iterable<Map.Entry<String, String>>) eim.getInfoStats().entrySet()) {
            /* 17182 */
            hashMap.put(entry.getKey(), (eim.getProperty(entry.getKey()).equals("1") && !String.valueOf(getMapId()).equals(entry.getKey())) ? "0" : eim.getProperty(entry.getKey()));
            /*       */
        }
        /* 17184 */
        sendGiantBossMap(hashMap);
        /*       */
    }

    /*       */
    /*       */
    public void sendGiantBossMap(Map<String, String> map) {
        /* 17188 */
        this.client.announce(MaplePacketCreator.SendGiantBossMap(map));
        /*       */
    }

    /*       */
    /*       */
    public long getRuneNextActionTime() {
        /* 17192 */
        long time = 0L;
        /* 17193 */
        if (getKeyValue("RUNE_NEXT_ACTION_TIME") != null) {
            /* 17194 */
            time = Long.valueOf(getKeyValue("RUNE_NEXT_ACTION_TIME")).longValue();
            /*       */
        }
        /* 17196 */
        return time;
        /*       */
    }

    /*       */
    /*       */
    public void setRuneNextActionTime(long time) {
        /* 17200 */
        setKeyValue("RUNE_NEXT_ACTION_TIME", String.valueOf(System.currentTimeMillis() + time));
        /*       */
    }

    /*       */
    /*       */
    public void sendDathCount() {
        /* 17204 */
        if (this.reviveCount >= 0) {
            /* 17205 */
            this.client.announce(MaplePacketCreator.IndividualDeathCountInfo(this.reviveCount));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getEnchant() {
        /* 17210 */
        return this.enchant;
        /*       */
    }

    /*       */
    /*       */
    public void setEnchant(int enchant) {
        /* 17214 */
        this.enchant = enchant;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle无敌(MapleStatEffect effect, int bufflength) {
        /* 17224 */
        send(BuffPacket.giveGodBuff(effect.getSourceid(), bufflength));
        /* 17225 */
        if (this.godSchedule != null) {
            /* 17226 */
            this.godSchedule.cancel(true);
            /*       */
        }
        /* 17228 */
        this.godSchedule = Timer.BuffTimer.getInstance().schedule(() -> send(BuffPacket.cancelBuff(Collections.singletonList(MapleBuffStat.无敌状态), this)), bufflength);
        /*       */
    }

    /*       */
    /*       */
    public void updateBuffEffect(MapleStatEffect effect, Map<MapleBuffStat, Integer> map) {
        /* 17232 */
        long time = System.currentTimeMillis() - (getBuffStatValueHolder((MapleBuffStat) map.keySet().iterator().next())).startTime;
        /* 17233 */
        send(BuffPacket.giveBuff(effect.getSourceid(), effect.getDuration() - (int) time, map, effect, this));
        /*       */
    }

    /*       */
    /*       */
    public long getLastUseVSkillTime() {
        /* 17237 */
        return this.lastUseVSkillTime;
        /*       */
    }

    /*       */
    /*       */
    public void setLastUseVSkillTime(long lastUseVSkillTime) {
        /* 17241 */
        this.lastUseVSkillTime = lastUseVSkillTime;
        /*       */
    }

    /*       */
    /*       */
    public long getLastUseSkillTime() {
        /* 17245 */
        return this.lastUseSkillTime;
        /*       */
    }

    /*       */
    /*       */
    public void setLastUseSkillTime(long lastUseSkillTime) {
        /* 17249 */
        this.lastUseSkillTime = lastUseSkillTime;
        /*       */
    }

    /*       */
    /*       */
    public long getLastUseSkillTimeExt(int skillId) {
        /* 17253 */
        if (!this.lastUseSkillTimeExt.containsKey(Integer.valueOf(skillId))) {
            /* 17254 */
            return 0L;
            /*       */
        }
        /*       */
        /* 17257 */
        return ((Long) this.lastUseSkillTimeExt.get(Integer.valueOf(skillId))).longValue();
        /*       */
    }

    /*       */
    /*       */
    public void setLastUseSkillTimeExt(int skillId, long lastUseSkillTime) {
        /* 17261 */
        this.lastUseSkillTimeExt.put(Integer.valueOf(skillId), Long.valueOf(lastUseSkillTime));
        /*       */
    }

    /*       */
    /*       */
    public void hadnleBlasterClip(int n2) {
        /* 17265 */
        if (JobConstants.is爆破手(this.job)) {
            /* 17266 */
            int n3 = Math.max(this.specialStats.getBullet() + n2, 0);
            /* 17267 */
            this.specialStats.setBullet(Math.min(n3, this.specialStats.getBullet()));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void hadnleCylinder(int n2) {
        /* 17272 */
        if (JobConstants.is爆破手(this.job)) {
            /* 17273 */
            int n3 = Math.max(getCylinder() + n2, 0);
            /* 17274 */
            this.specialStats.setCylinder(Math.min(n3, this.specialStats.getBullet()));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getCylinder() {
        /* 17279 */
        return JobConstants.is爆破手(this.job) ? this.specialStats.getCylinder() : 0;
        /*       */
    }

    /*       */
    /*       */
    public int getBullet() {
        /* 17283 */
        return JobConstants.is爆破手(this.job) ? this.specialStats.getBullet() : 0;
        /*       */
    }

    /*       */
    /*       */
    public void hadnleBlasterSkill(int skillid) {
        /* 17287 */
        if (JobConstants.is爆破手(this.job)) {
            /* 17288 */
            switch (skillid) {
                /*       */
                case 37001000:
                    /*       */
                case 37101000:
                    /*       */
                case 37121004:
                    /* 17292 */
                    send(MaplePacketCreator.SkillFeed());
                    /* 17293 */
                    send(MaplePacketCreator.RegisterExtraSkill(this, skillid, 37000006));
                    /*       */
                    break;
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void hadnleChargeBlaster() {
        /* 17300 */
        MapleStatEffect effect = SkillFactory.getSkill(37000010).getEffect(getSkillLevel(37000010));
        /* 17301 */
        if (JobConstants.is爆破手(this.job) && getBullet() <= 0 && effect != null) {
            /* 17302 */
            effect.applyTo(this);
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getHurtHP() {
        /* 17307 */
        return this.specialStats.getHurtHP();
        /*       */
    }

    /*       */
    /*       */
    public void hadnle忍耐之盾(int n2) {
        /* 17311 */
        if (JobConstants.is爆破手(this.job) && getStatForBuff(MapleBuffStat.忍耐之盾) == null) {
            /* 17312 */
            this.specialStats.setHurtHP(n2);
            /* 17313 */
            MapleStatEffect effect = SkillFactory.getSkill(37000006).getEffect(getTotalSkillLevel(37000006));
            /* 17314 */
            if (isAlive() && effect != null) {
                /* 17315 */
                effect.applyTo(this, true);
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void updateShinasBless() {
        /* 17321 */
        int[] arrn = {80000066, 80000067, 80000068, 80000069, 80000070};
        /* 17322 */
        int n2 = 0;
        /* 17323 */
        Optional<Skill> skill = Optional.ofNullable(SkillFactory.getSkill(80000055));
        /* 17324 */
        for (int n3 : arrn) {
            /* 17325 */
            Skill an3 = SkillFactory.getSkill(n3);
            /* 17326 */
            if (an3 != null && getSkillLevel(an3) > 0) {
                /* 17327 */
                n2 += getSkillLevel(an3);
                /*       */
            }
            /*       */
        }
        /* 17330 */
        int finalN = n2;
        /* 17331 */
        skill.ifPresent(skill1 -> changeSkillData(skill1, (finalN == 0) ? -1 : finalN, (byte) skill1.getMasterLevel(), -1L));
        /*       */
    }

    /*       */
    /*       */
    /*       */
    public void doAnimabuff() {
        /* 17336 */
        if (JobConstants.is唤灵斗师(getJob())) {
            /* 17337 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.战法灵气);
            /* 17338 */
            if (effect != null) {
                /* 17339 */
                switch (effect.getSourceid()) {
                    /*       */
                    case 32001016:
                        /*       */
                    case 32101009:
                        /*       */
                    case 32111012:
                        /*       */
                    case 32121017:
                        /* 17344 */
                        if (getParty() != null) {
                            /* 17345 */
                            effect.applyTo(this, false);
                            /*       */
                        }
                        /*       */
                        break;
                    /*       */
                    /*       */
                    case 32121018:
                        /* 17350 */
                        effect.applyTo(this, true);
                        /*       */
                        break;
                    /*       */
                }
                /* 17353 */
                addMP(-effect.getMpCon());
                /* 17354 */
                if (getStat().getMp() < effect.getMpCon()) {
                    /* 17355 */
                    cancelEffectFromBuffStat(MapleBuffStat.战法灵气);
                    /*       */
                }
                /*       */
            }
            /* 17358 */
        } else if (JobConstants.is神之子(getJob())) {
            /* 17359 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.神圣迅捷);
            /* 17360 */
            if (effect != null && getParty() != null) {
                /* 17361 */
                effect.applyTo(this, false);
                /*       */
            }
            /* 17363 */
            if ((effect = getStatForBuff(MapleBuffStat.圣洁之力)) != null && getParty() != null) {
                /* 17364 */
                effect.applyTo(this, false);
                /*       */
            }
            /* 17366 */
        } else if (JobConstants.is火毒(getJob())) {
            /* 17367 */
            int n2 = getTotalSkillLevel(2100009);
            /* 17368 */
            if (n2 > 0) {
                /* 17369 */
                Skill skill = SkillFactory.getSkill(2100009);
                /* 17370 */
                MapleStatEffect effect = skill.getEffect(n2);
                /* 17371 */
                if (effect.a(this, MonsterStatus.MOB_STAT_Poison) > 0) {
                    /* 17372 */
                    effect.applyTo(this);
                    /*       */
                } else {
                    /* 17374 */
                    cancelEffectFromBuffStat(MapleBuffStat.元素爆破);
                    /*       */
                }
                /*       */
            }
            /* 17377 */
        } else if (JobConstants.is米哈尔(getJob())) {
            /* 17378 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.灵魂链接);
            /* 17379 */
            MapleBuffStatValueHolder valueHolder = getBuffStatValueHolder(MapleBuffStat.灵魂链接);
            /* 17380 */
            if (effect != null && getParty() != null && valueHolder != null && valueHolder.fromChrId == getId()) {
                /* 17381 */
                addMP(-effect.getMpCon());
                /* 17382 */
                effect.applyTo(this, false);
                /* 17383 */
                if (getStat().getMp() < effect.getMpCon()) {
                    /* 17384 */
                    cancelEffectFromBuffStat(MapleBuffStat.灵魂链接);
                    /*       */
                }
                /*       */
            }
            /* 17387 */
        } else if (JobConstants.is剑豪(getJob())) {
            /* 17388 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.拔刀术加成);
            /* 17389 */
            MapleBuffStatValueHolder valueHolder = getBuffStatValueHolder(MapleBuffStat.拔刀术加成);
            /* 17390 */
            if (effect != null && valueHolder != null && valueHolder.fromChrId == getId()) {
                /* 17391 */
                addMP(-3);
                /* 17392 */
                if (getStat().getMp() < 3) {
                    /* 17393 */
                    cancelEffectFromBuffStat(MapleBuffStat.拔刀术加成);
                    /*       */
                }
                /*       */
            }
            /* 17396 */
        } else if (JobConstants.is主教(getJob())) {
            /* 17397 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.祈祷);
            /* 17398 */
            if (effect != null && getParty() != null) {
                /* 17399 */
                effect.h(this, false);
                /*       */
            }
            /* 17401 */
        } else if (JobConstants.is恶魔复仇者(getJob())) {
            /* 17402 */
            MapleStatEffect effect = getStatForBuff(MapleBuffStat.恶魔狂怒);
            /* 17403 */
            if (effect != null && (getStat().getHp() - effect.getY()) > getStat().getCurrentMaxHp() * effect.getQ2() / 100.0D) {
                /* 17404 */
                addHPMP(-effect.getY(), 0);
                /* 17405 */
                send(MaplePacketCreator.userBonusAttackRequest(400010010, 0, Collections.emptyList()));
                /*       */
            }
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public int getBadgeUpgradeCount(Equip nEquip) {
        /* 17414 */
        int count = 12;
        /* 17415 */
        switch (nEquip.getARCLevel()) {
            /*       */
            case 1:
                /* 17417 */
                count = 12;
                /*       */
                break;
            /*       */
            case 2:
                /* 17420 */
                count = 15;
                /*       */
                break;
            /*       */
            case 3:
                /* 17423 */
                count = 20;
                /*       */
                break;
            /*       */
            case 4:
                /* 17426 */
                count = 27;
                /*       */
                break;
            /*       */
            case 5:
                /* 17429 */
                count = 36;
                /*       */
                break;
            /*       */
            case 6:
                /* 17432 */
                count = 47;
                /*       */
                break;
            /*       */
            case 7:
                /* 17435 */
                count = 60;
                /*       */
                break;
            /*       */
            case 8:
                /* 17438 */
                count = 75;
                /*       */
                break;
            /*       */
            case 9:
                /* 17441 */
                count = 92;
                /*       */
                break;
            /*       */
            case 10:
                /* 17444 */
                count = 111;
                /*       */
                break;
            /*       */
            case 11:
                /* 17447 */
                count = 132;
                /*       */
                break;
            /*       */
            case 12:
                /* 17450 */
                count = 155;
                /*       */
                break;
            /*       */
            case 13:
                /* 17453 */
                count = 180;
                /*       */
                break;
            /*       */
            case 14:
                /* 17456 */
                count = 207;
                /*       */
                break;
            /*       */
            case 15:
                /* 17459 */
                count = 236;
                /*       */
                break;
            /*       */
            case 16:
                /* 17462 */
                count = 267;
                /*       */
                break;
            /*       */
            case 17:
                /* 17465 */
                count = 300;
                /*       */
                break;
            /*       */
            case 18:
                /* 17468 */
                count = 335;
                /*       */
                break;
            /*       */
            case 19:
                /* 17471 */
                count = 372;
                /*       */
                break;
            /*       */
            case 20:
                /* 17474 */
                count = 372;
                /*       */
                break;
            /*       */
        }
        /* 17477 */
        return count;
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void addDeformationCount(int delta) {
        /* 17484 */
        if (!JobConstants.is影魂异人(getJob())) {
            /*       */
            return;
            /*       */
        }
        /* 17487 */
        if (setDeformationCount(this.specialStats.getDeformationCount() + delta)) {
            /* 17488 */
            this.stats.recalcLocalStats(this);
            /* 17489 */
            this.client.announce(BuffPacket.updateDeformationCount(getJob(), this.specialStats.getDeformationCount()));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public boolean setDeformationCount(int count) {
        /* 17497 */
        int oldDeformation = this.specialStats.getDeformationCount();
        /* 17498 */
        int tempDeformation = count;
        /* 17499 */
        if (tempDeformation < 0) {
            /* 17500 */
            tempDeformation = 0;
            /*       */
        }
        /* 17502 */
        if (tempDeformation > 1000) {
            /* 17503 */
            tempDeformation = 1000;
            /*       */
        }
        /* 17505 */
        this.specialStats.setDeformationCount(tempDeformation);
        /* 17506 */
        return (this.specialStats.getDeformationCount() != oldDeformation);
        /*       */
    }

    /*       */
    /*       */
    public void handle追魂手() {
        /* 17510 */
        Skill skill = SkillFactory.getSkill(155100009);
        /* 17511 */
        MapleStatEffect effect = skill.getEffect(getTotalSkillLevel(155100009));
        /* 17512 */
        if (effect != null) {
            /* 17513 */
            List<MapleMapObject> mobs = getMap().getMonstersInRange(getPosition(), 100000.0D);
            /* 17514 */
            List<Integer> mobids = new ArrayList<>();
            /* 17515 */
            if (mobs.isEmpty()) {
                /*       */
                return;
                /*       */
            }
            /* 17518 */
            for (int i = 0; i < effect.getMobCount(); i++) {
                /* 17519 */
                mobids.add(Integer.valueOf(((MapleMapObject) mobs.get(Randomizer.nextInt(mobs.size()))).getObjectId()));
                /*       */
            }
            /* 17521 */
            MapleForce mapleForce = new MapleForce(this.id, 155100009, 0, MapleForceType.追魂手, (byte) 1, mobids, (byte) 0, effect.getAttackCount(), getMap(), effect.getBulletCount());
            /* 17522 */
            this.client.announce(ForcePacket.showForce(mapleForce));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    /*       */
    /*       */
    /*       */
    public void handle暴虐双生神() {
        /* 17530 */
        MapleStatEffect effect = SkillFactory.getSkill(400011077).getEffect(getSkillLevel(400011077));
        /* 17531 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /* 17534 */
        MapleSummon summon = getSummonBySkill(effect.getSourceid());
        /* 17535 */
        if (summon == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 17539 */
        if (summon.checkLastAttackTime()) {
            /* 17540 */
            getMap().broadcastMessage(SummonPacket.summonSkillLink(this.id, summon.getObjectId(), 0), getTruePosition());
            /*       */
        }
        /*       */
        /* 17543 */
        effect = SkillFactory.getSkill(400011078).getEffect(getSkillLevel(400011078));
        /* 17544 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /* 17547 */
        summon = getSummonBySkill(effect.getSourceid());
        /* 17548 */
        if (summon == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 17552 */
        if (summon.checkLastAttackTime()) {
            /* 17553 */
            getMap().broadcastMessage(SummonPacket.summonSkillLink(this.id, summon.getObjectId(), 0), getTruePosition());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void handle吉祥物随从() {
        /* 17558 */
        MapleStatEffect effect = SkillFactory.getSkill(400051046).getEffect(getSkillLevel(400051046));
        /* 17559 */
        if (effect == null) {
            /*       */
            return;
            /*       */
        }
        /* 17562 */
        MapleSummon summon = getSummonBySkill(effect.getSourceid());
        /* 17563 */
        if (summon == null) {
            /*       */
            return;
            /*       */
        }
        /*       */
        /* 17567 */
        if (summon.checkLastAttackTime()) {
            /* 17568 */
            getMap().broadcastMessage(SummonPacket.summonSkillLink(this.id, summon.getObjectId(), 0), getTruePosition());
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public int getChatColor() {
        /* 17573 */
        if (!this.keyValue.containsKey("CHAT_COLOR")) {
            /* 17574 */
            return ServerConstants.ChatColor.DEFAULT_CHAT_COLOR;
            /*       */
        }
        /* 17576 */
        return Integer.parseInt(this.keyValue.get("CHAT_COLOR"));
        /*       */
    }

    /*       */
    /*       */
    public void setChatColor(String color) {
        /* 17580 */
        this.keyValue.put("CHAT_COLOR", String.valueOf(ServerConstants.ChatColor.valueOf(color).getColor()));
        /* 17581 */
        this.changed_keyValue = true;
        /*       */
    }

    /*       */
    /*       */
    public final int addWreckages(Point point, int lasttime) {
        /* 17585 */
        int lastForceAtom = getCheatTracker().getLastForceAtom();
        /* 17586 */
        this.evanWreckages.add(new Triple(Integer.valueOf(lastForceAtom), Long.valueOf(System.currentTimeMillis() + lasttime), point));
        /* 17587 */
        return lastForceAtom;
        /*       */
    }

    /*       */
    /*       */
    public final Map<Integer, Point> getWreckagesMap() {
        /* 17591 */
        HashMap<Integer, Point> hashMap = new HashMap<>();
        /* 17592 */
        this.evanWreckages.forEach(it -> {
            /*       */
            if (((Long) it.mid).longValue() > System.currentTimeMillis()) {
                /*       */
                hashMap.put(it.left, it.right);
                /*       */
            }
            /*       */
        });
        /* 17597 */
        this.evanWreckages.clear();
        /* 17598 */
        return hashMap;
        /*       */
    }

    /*       */
    /*       */
    public final List getEvanWreckages() {
        /* 17602 */
        return this.evanWreckages;
        /*       */
    }

    /*       */
    /*       */
    public final void cleanEvanWreckages() {
        /* 17606 */
        this.evanWreckages.clear();
        /*       */
    }

    /*       */
    /*       */
    public final void showScreenEffect(String s) {
        /* 17610 */
        showScreenEffect(FieldEffectOpcode.Screen.getValue(), s, 0);
        /*       */
    }

    /*       */
    /*       */
    public final void showTopScreenEffect(String s, int n) {
        /* 17614 */
        showScreenEffect(FieldEffectOpcode.TopScreen.getValue(), s, n);
        /*       */
    }

    /*       */
    /*       */
    public final void showScreenDelayedEffect(String s, int n) {
        /* 17618 */
        showScreenEffect(FieldEffectOpcode.Screen_Delayed.getValue(), s, n);
        /*       */
    }

    /*       */
    /*       */
    public final void showScreenAutoLetterBox(String s, int n) {
        /* 17622 */
        showScreenEffect(FieldEffectOpcode.Screen_Delayed.getValue(), s, n);
        /*       */
    }

    /*       */
    /*       */
    public final void showScreenEffect(int opcode, String s, int n2) {
        /* 17626 */
        if (this.client != null) {
            /* 17627 */
            this.client.announce(MaplePacketCreator.showSceenEffect(opcode, s, n2));
            /*       */
        }
        /*       */
    }

    /*       */
    /*       */
    public void setChanged_union(boolean changed_union) {
        /* 17632 */
        this.changed_union = changed_union;
        /*       */
    }

    /*       */
    /*       */
    public MapleUnion getMapleUnion() {
        /* 17636 */
        return this.mapleUnion;
        /*       */
    }

    /*       */
    /*       */
    public void setMapleUnion(MapleUnion mapleUnion) {
        /* 17640 */
        this.mapleUnion = mapleUnion;
        /*       */
    }

    /*       */
    /*       */
    public boolean hasMapScript() {
        /* 17644 */
        return (this.mapScript.getLeft() != MapScriptMethods.MapScriptType.UNK);
        /*       */
    }

    /*       */
    /*       */
    public Pair<MapScriptMethods.MapScriptType, String> getMapScript() {
        /* 17648 */
        return this.mapScript;
        /*       */
    }

    /*       */
    /*       */
    public void updateMapScript(MapScriptMethods.MapScriptType mapScriptType, String string) {
        /* 17652 */
        this.mapScript.left = mapScriptType;
        /* 17653 */
        this.mapScript.right = string;
        /*       */
    }

    /*       */
    /*       */
    public void setChanged_familiars(boolean changed_familiars) {
        /* 17657 */
        this.changed_familiars = changed_familiars;
        /*       */
    }

    /*       */
    /*       */
    public boolean isChanged_familiars() {
        /* 17661 */
        return this.changed_familiars;
        /*       */
    }

    /*       */
    /*       */
    public int getLastSkill() {
        /* 17665 */
        return this.lastSkill;
        /*       */
    }

    /*       */
    /*       */
    public void setLastSkill(int lastSkill) {
        /* 17669 */
        this.lastSkill = lastSkill;
        /*       */
    }

    /*       */
    /*       */
    public int getBuffValue() {
        /* 17673 */
        return this.buffValue;
        /*       */
    }

    /*       */
    /*       */
    public void setBuffValue(int buffValue) {
        /* 17677 */
        this.buffValue = buffValue;
        /*       */
    }

    /*       */
    /*       */
    public long getLastComboTime() {
        /* 17681 */
        return this.lastComboTime;
        /*       */
    }

    /*       */
    /*       */
    public void setLastComboTime(long lastComboTime) {
        /* 17685 */
        this.lastComboTime = lastComboTime;
        /*       */
    }

    /*       */
    /*       */
    public HiredFisher getHiredFisher() {
        /* 17689 */
        return this.hiredFisher;
        /*       */
    }

    /*       */
    /*       */
    public void setHiredFisher(HiredFisher hiredFisher) {
        /* 17693 */
        this.hiredFisher = hiredFisher;
        /*       */
    }

    /*       */
    /*       */
    public MapleCharacter() {
    }

    /*       */
    /* 17698 */   public enum FameStatus {
        OK,
        /* 17699 */     NOT_TODAY,
        /* 17700 */     NOT_THIS_MONTH;
    }

    /*       */
    /*       */
    /*       */   public class PlayerObservable
            /*       */ extends Observable {
        /*       */     final MapleCharacter player;

        /*       */
        /*       */
        public PlayerObservable(MapleCharacter player) {
            /* 17708 */
            this.player = player;
            /*       */
        }

        /*       */
        /*       */
        public MapleCharacter getPlayer() {
            /* 17712 */
            return this.player;
            /*       */
        }

        /*       */
        /*       */
        public void update() {
            /* 17716 */
            setChanged();
            /* 17717 */
            notifyObservers(this.player);
            /*       */
        }
        /*       */
    }
    /*       */
}


/* Location:              C:\PGX\Server.jar!\client\MapleCharacter.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */